小智 13
find . -not -empty -type f -printf "%s\n" | sort -rn | uniq -d |\
xargs -I{} -n1 find . -type f -size {}c -print0 | xargs -0 md5sum |\
sort | uniq -w32 --all-repeated=separate
Run Code Online (Sandbox Code Playgroud)
这就是你想要的方式.首先根据大小找到dup,然后是MD5哈希.请注意与您的问题相关的-size的使用.请享用.假设您要在当前目录中搜索.如果没有,请更改"查找".适合您要搜索的目录.
Gil*_*not 12
不要重新发明轮子,使用正确的命令:
fdupes -r dir
Run Code Online (Sandbox Code Playgroud)
请参阅http://code.google.com/p/fdupes/(打包在某些Linux发行版上)