$ rdfind ~ Now scanning "/home/shark", found 12 files. Now have 12 files in total. Removed 1 files due to nonunique device and inode. Total size is 699498 bytes or 683 KiB Removed 9 files due to unique sizes from list.2 files left. Now eliminating candidates based on first bytes:removed 0 files from list.2 files left. Now eliminating candidates based on last bytes:removed 0 files from list.2 files left. Now eliminating candidates based on sha1 checksum:removed 0 files from list.2 files left. It seems like you have 2 files that are not unique Totally, 223 KiB can be reduced. Now making results file results.txt
你可以在 dryrun 模式中运行这个命令 (换句话说,仅仅汇报可能会另外被做出的改动)。
1 2 3 4 5 6 7 8 9 10 11 12
$ rdfind -dryrun true ~ (DRYRUN MODE) Now scanning "/home/shark", found 12 files. (DRYRUN MODE) Now have 12 files in total. (DRYRUN MODE) Removed 1 files due to nonunique device and inode. (DRYRUN MODE) Total size is 699352 bytes or 683 KiB Removed 9 files due to unique sizes from list.2 files left. (DRYRUN MODE) Now eliminating candidates based on first bytes:removed 0 files from list.2 files left. (DRYRUN MODE) Now eliminating candidates based on last bytes:removed 0 files from list.2 files left. (DRYRUN MODE) Now eliminating candidates based on sha1 checksum:removed 0 files from list.2 files left. (DRYRUN MODE) It seems like you have 2 files that are not unique (DRYRUN MODE) Totally, 223 KiB can be reduced. (DRYRUN MODE) Now making results file results.txt
rdfind 命令同样提供了类似忽略空文档(-ignoreempty)和跟踪符号链接(-followsymlinks)的功能。查看 man 页面获取解释。
1 2 3 4 5 6 7 8 9 10 11 12 13
-ignoreempty ignore empty files -minsize ignore files smaller than speficied size -followsymlinks follow symbolic links -removeidentinode remove files referring to identical inode -checksum identify checksum type to be used -deterministic determiness how to sort files -makesymlinks turn duplicate files into symbolic links -makehardlinks replace duplicate files with hard links -makeresultsfile create a results file in the current directory -outputname provide name for results file -deleteduplicates delete/unlink duplicate files -sleep set sleep time between reading files (milliseconds) -n, -dryrun display what would have been done, but don't do it
-r --recurse recurse -R --recurse: recurse through specified directories -s --symlinks follow symlinked directories -H --hardlinks treat hard links as duplicates -n --noempty ignore empty files -f --omitfirst omit the first file in each set of matches -A --nohidden ignore hidden files -1 --sameline list matches on a single line -S --size show size of duplicate files -m --summarize summarize duplicate files information -q --quiet hide progress indicator -d --delete prompt user for files to preserve -N --noprompt when used with --delete, preserve the first file in set -I --immediate delete duplicates as they are encountered -p --permissions don't soncider files with different owner/group or permission bits as duplicates -o --order=WORD order files according to specification -i --reverse reverse order while sorting -v --version display fdupes version -h --help displays help
fdupes 命令是另一个你可能需要安装并使用一段时间才能熟悉其众多选项的命令。
总结
Linux 系统提供能够定位并(潜在地)能移除重复文件的一系列的好工具,以及能让你指定搜索区域及当对你所发现的重复文件时的处理方式的选项。