Fixed a bug due to using strncmp instead of memcmp (ahem).
[finddup.git] / finddup.1
1 .TH "FINDDUP" 1 "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 [[not:]DIR2]
14
15 .SH "DESCRIPTION"
16
17 With a single directory argument, \fBfinddup\fP prints the duplicated
18 files found in it. With two directories, it prints either the files
19 common to both DIR1 and DIR2, or with the `not:' prefix, the ones
20 present in DIR1 and not in DIR2.
21
22 It compares files by first comparing their sizes, hence goes
23 reasonably fast.
24
25 When looking for identical files, \fBfinddup\fP associates by default
26 a group ID to every content, and prints it along the file names.
27
28 Note that
29 .B finddup DIR
30 is the same as
31 .B finddup -i DIR DIR
32
33 .SH "OPTIONS"
34 .TP
35 \fB-h\fR
36 display help and exit
37 .TP
38 \fB-d\fR
39 ignore files and directories starting with a dot
40 .TP
41 \fB-0\fR
42 ignore empty files
43 .TP
44 \fB-c\fR
45 do not show which files from DIR2 corresponds to files from DIR1
46 (hence, show only the files from DIR1 which have an identical twin in
47 DIR2)
48 .TP
49 \fB-g\fR
50 do not show the file group IDs
51 .TP
52 \fB-p\fR
53 show progress information in stderr
54 .TP
55 \fB-r\fR
56 show the real path of the files
57 .TP
58 \fB-i\fR
59 files with same inode are considered as different
60
61 .SH "BUGS"
62
63 None known, probably many. Valgrind does not complain though.
64
65 .SH "WISH LIST"
66
67 The format of the output should definitely be improved. Not clear how.
68
69 The comparison algorithm could definitely use some MD5 kind of
70 signature. However, I doubt it would improve speed much.
71
72 Their should be some fancy option to link two instances of the command
73 running on different machines to reduce network disk accesses.
74
75 .SH "EXAMPLES"
76
77 .B finddup -cg blah something
78
79 .fi
80 List files found in \fB./blah/\fR which have a matching file with same
81 content in \fB./something/\fR. Do not display the group IDs.
82
83 .P
84 .B finddup sources not:/mnt/backup
85
86 .fi
87 List all files found in \fB./sources/\fR which do not have
88 content-matching equivalent in \fB/mnt/backup\fR.
89
90 .P
91 .B finddup tralala cuicui
92
93 .fi
94 List groups of files with same content which exist both in
95 \fB./tralala/\fR and \fB./cuicui/\fR.
96
97 .SH "AUTHOR"
98
99 Written by Francois Fleuret <francois@fleuret.org> and distributed
100 under the terms of the GNU General Public License version 3 as
101 published by the Free Software Foundation. This is free software: you
102 are free to change and redistribute it. There is NO WARRANTY, to the
103 extent permitted by law.