Sign in with
Sign up | Sign in
Your question

Linux shell script to find duplicate images

Tags:
  • Shell Script
  • Linux
Last response: in Linux/Free BSD
Share
Anonymous
February 18, 2010 10:30:32 AM

Hello,
I am just starting to use linux. Could anybody help me?

I am looking for a shell script to find and remove duplicate image files

More about : linux shell script find duplicate images

July 9, 2010 3:48:37 AM

[code]

find . -type f -print0 | xargs -0 file | grep 'image data' | cut -f1 -d: | tr '\012' '\000' | xargs -0 md5sum | sort | uniq -w 32 -D

[\code]
July 9, 2010 3:50:38 AM

Oh... there's a one in a gabillion chance or so of a md5 hash collision (a false positive)... I doubt you'll ever see it though.
July 9, 2010 3:47:15 PM

The following handles filtering out duplicate inodes first... which we'll say aren't bad duplicates.

find . -type f -print0 | xargs -0 file | grep 'image data' | cut -f1 -d: | tr '\012' '\000' | xargs -0 ls -id | sort | uniq -w 6 | sed 's/^[^ ]*[ ]*//' | tr '\012' '\000' | xargs -0 md5sum | sort | uniq -w 32 -D
February 15, 2011 11:01:50 AM

You can try Clone Remover. It will help you find duplicate images (photos, pictures). Search by contents – files may have different names, but similar content. You can also use filters to search for duplicates of a certain type only. Try it.
http://www.moleskinsoft.com
!