Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell 按内容查找Unix中的重复文件_Shell_Unix - Fatal编程技术网

Shell 按内容查找Unix中的重复文件

Shell 按内容查找Unix中的重复文件,shell,unix,Shell,Unix,如何按内容而不是文件名递归查找重复文件列表查找-类型f-exec basename{}\|sed's/(../\1/“| sort | uniq-c | grep-v”^[\t]*1” 这将使用文件夹搜索重复的文件。为每个文件计算哈希,然后检查冲突。一个好的开始:find-f型-exec md5sum{}\|排序grep-rH'要查找的内容'| cut-d:-f1 | uniq |{读取时-r行;执行md5sum“$line”;完成;}

如何按内容而不是文件名递归查找重复文件列表

查找-类型f-exec basename{}\|sed's/(../\1/“| sort | uniq-c | grep-v”^[\t]*1”


这将使用文件夹搜索重复的文件。

为每个文件计算哈希,然后检查冲突。一个好的开始:
find-f型-exec md5sum{}\|排序
grep-rH'要查找的内容'| cut-d:-f1 | uniq |{读取时-r行;执行md5sum“$line”;完成;}