查找重复的图像文件 [英] Finding Duplicate image files

查看:135
本文介绍了查找重复的图像文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大约1 TB的图像,存储在我的硬盘中。这些是随着时间的推移拍摄的朋友和家人的照片。这些图片中的许多都是重复的,在某种意义上,相同的文件保存在不同的位置,可能也有不同的名称。我想问一下是否有任何工具,实用程序或方法(我可以编写一个)来找出重复的文件。

I have around 1 TB of images, stored in my hard disk. These are pictures taken over time of friends and family. Many of these pictures are duplicates, in the sense, same file saved in different locations, probably with different name too. I want to ask is there any tool, utility or approach(I can code one ) to find out the duplicate files.

推荐答案

我建议使用 md5deep或sha1deep 。在Linux上只需安装软件包 md5deep (它包含在大多数Linux发行版中)。

I would recommend using md5deep or sha1deep. On Linux simply install package md5deep (it is included in most Linux distributions).

安装完成后,只需在整个磁盘上以递归模式运行它,并使用以下命令将磁盘上每个文件的校验和保存到文本文件中:

Once you have it installed, simply run it in recursive mode over your whole disk and save checksums for every file on your disk into text file using command like this:

md5deep -r -l . > filelist.txt

如果你喜欢 sha1 更好比 md5 ,改为使用 sha1deep (它是同一个包的一部分)。

If you like sha1 better than md5, use sha1deep instead (it is part of the same package).

获得文件后,只需使用 sort 对其进行排序(或将其输入 sort 在上一步中):

Once you have a file, simply sort it using sort (or pipe it into sort in previous step):

sort < filelist.txt > filelist_sorted.txt

现在,只需使用任何文本编辑器查看结果 - 您将很快看到所有与它们在磁盘上的位置重复。

Now, simply look at the result using any text editor - you will quickly see all the duplicates alongside with their locations on disk.

如果您愿意,可以在Perl或Python中编写简单的脚本,以根据此文件列表删除重复项。

If you are so inclined, you can write simple script in Perl or Python to remove duplicates based on this file list.

这篇关于查找重复的图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆