[user@notebook foobar]$ ls *.jpg|wc -l
1959
[user@notebook foobar]$ cksum * | cut -d' ' -f-2 | sort | uniq -di | wc -l
698
[user@notebook foobar]$
目录中有许多jpg文件。许多文件是重复的,但是如果cksum与它们相同,我可以找出它们。有时,同一图片有2或3个文件。
问:如何删除不需要的重复项?
我需要在每张图片中保留1张,因此,如果存在3张完全相同的图片,但文件名不同,则只应保留其中一张,这样就不会有图片的重复,该怎么做?
使用fdupes:
fdupes -dN .
男人fdupes:
-d --delete
prompt user for files to preserve, deleting all others (see
CAVEATS below)
-N --noprompt
when used together with --delete, preserve the first file in
each set of duplicates and delete the others without prompting
the user
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句