Linux shell script to find duplicate images

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
4 answers Last reply
More about linux shell script find duplicate images
  1. how would you define duplicate?
    two distinct images can have the same name under different locations. do you want to check on the bit level too? if so, then I don't think it is doable with shell
    but googling returns this hit : http://embraceubuntu.com/2005/10/08/find-duplicate-copies-of-files/
    here is a shell script for identical name http://www.unix.com/shell-programming-scripting/30770-how-find-duplicate-files-find.html


  2. 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]
  3. 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.
  4. 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
Ask a new question

Read More

Shell Script Linux