fdupes [ options ] DIRECTORY
# found by comparing file sizes and MD5
-r --recurse
-d --delete
prompt user for files to preserve, deleting all others
-q --quiet
hide progress indicator
-N --noprompt (fdupes-1.51 才有此功能)
when used together with --delete, preserve the first file in each set of duplicates and delete
the others without prompting the user
-f --omitfirst
omit the first file in each set of matches
-m --summarize
summarize duplicate files information
P.S.
When used together with options -s or --symlink, a user could accidentally preserve a symlink while
deleting the file it points to.
-H --hardlinks
normally, when two or more files point to the same disk area they are treated as non-duplicates; this option will change this behavior
Example:
server:~# fdupes -r tmp1
tmp1/testfile.txt tmp1/testfile1.txt tmp1/testfile2.txt tmp1/testfile3.txt tmp1/testfile4.txt
server:~# fdupes -r -d tmp1
[1] tmp1/testfile.txt [2] tmp1/testfile2.txt [3] tmp1/testfile3.txt [4] tmp1/testfile1.txt Set 1 of 1, preserve files [1 - 4, all]:
server:~# fdupes -m tmp1
4 duplicate files (in 1 sets), occupying 44 bytes.
server:~# fdupes -f tmp1
tmp1/testfile1.txt tmp1/testfile2.txt tmp1/testfile3.txt tmp1/testfile4.txt
# Delete 重複而不問多次
fdupes -r -d -N .2011-07-08
Output
Progress [1265/33979] 3%
附加檔案 | 大小 |
---|---|
fdupes-1.51.tar_.gz | 47.79 KB |