Fixed the version number.
[finddup.git] / finddup.1
1 .TH "FINDDUP" "1.0" "Mar 2010" "Francois Fleuret" "User Commands"
2
3 \" This man page was written by Francois Fleuret <francois@fleuret.org>
4 \" and is distributed under a Creative Commons Attribution-Share Alike
5 \" 3.0 License.
6
7 .SH "NAME"
8
9 finddup \- Find files common to two directories (or not)
10
11 .SH "SYNOPSIS"
12
13 \fBfinddup\fP [OPTION]... [DIR1 [[and:|not:]DIR2]]
14
15 .SH "DESCRIPTION"
16
17 With one directory as argument, \fBfinddup\fP prints the duplicated
18 files found in it. If no directory is provided, it uses the current
19 one as default.
20
21 With two directories, it prints either the files common to both DIR1
22 and DIR2 or, with the `not:' prefix, the ones present in DIR1 and not
23 in DIR2. The and: prefix is assumed by default and necessary only if
24 you have a directory name starting with `not:'.
25
26 This command compares files by first comparing their sizes, hence goes
27 reasonably fast.
28
29 When looking for identical files, \fBfinddup\fP associates a group ID
30 to every content, and prints it along the file names. Use the \fB-g\fP
31 to switch it off.
32
33 Note that
34 .B finddup DIR
35 is virtually the same as
36 .B finddup -i DIR DIR
37
38 .SH "OPTIONS"
39 .TP
40 \fB-h\fR, \fB--help\fR
41 display help and exit
42 .TP
43 \fB-d\fR, \fB--ignore-dots\fR
44 ignore files and directories starting with a dot
45 .TP
46 \fB-0\fR, \fB--ignore-empty\fR
47 ignore empty files
48 .TP
49 \fB-c\fR, \fB--hide-matchings\fR
50 do not show which files from DIR2 corresponds to files from DIR1
51 (hence, show only the files from DIR1 which have an identical twin in
52 DIR2)
53 .TP
54 \fB-g\fR, \fB--no-group-ids\fR
55 do not show the file group IDs
56 .TP
57 \fB-p\fR, \fB--show-progress\fR
58 show progress information in stderr
59 .TP
60 \fB-r\fR, \fB--real-paths\fR
61 show the real path of the files
62 .TP
63 \fB-i\fR, \fB--same-inodes-are-different\fR
64 files with same inode are considered as different
65
66 .SH "BUGS"
67
68 None known, probably many. Valgrind does not complain though.
69
70 The current algorithm is dumb, as it does not use any hashing of the
71 file content.
72
73 Here are the things I tried, which did not help at all: (1) Computing
74 md5s on the whole files, which is not satisfactory because files are
75 often not read entirely, hence the md5s can not be properly computed,
76 (2) computing XORs of the first 4, 16 and 256 bytes with rejection as
77 soon as one does not match, (3) reading files in parts of increasing
78 sizes so that rejection could be done with only a small fraction read
79 when possible, (4) using mmap instead of open/read.
80
81 .SH "WISH LIST"
82
83 The format of the output should definitely be improved. Not clear how.
84
85 Their could be some fancy option to link two instances of the command
86 running on different machines to reduce network disk accesses. This
87 may not help much though.
88
89 .SH "EXAMPLES"
90
91 .B finddup -p0d blah
92
93 .fi
94 List duplicated files in directory ./blah/, show a progress bar,
95 ignore empty files, and ignore files and directories starting with a
96 dot.
97
98 .P
99 .B finddup sources not:/mnt/backup
100
101 .fi
102 List all files found in \fB./sources/\fR which do not have
103 content-matching equivalent in \fB/mnt/backup/\fR.
104
105 .P
106 .B finddup -g tralala cuicui
107
108 .fi
109 List groups of files with same content which exist both in
110 \fB./tralala/\fR and \fB./cuicui/\fR. Do not show group IDs, instead
111 write an empty lines between groups of files of same content.
112
113 .SH "AUTHOR"
114
115 Written by Francois Fleuret <francois@fleuret.org> and distributed
116 under the terms of the GNU General Public License version 3 as
117 published by the Free Software Foundation. This is free software: you
118 are free to change and redistribute it. There is NO WARRANTY, to the
119 extent permitted by law.