[ale] Looking for duplicate photos

Geoffrey esoteric at 3times25.net
Sun Feb 6 20:25:08 EST 2005


Trey Sizemore wrote:

> Duplicate images with duplicate file names.

This is not tested, it's up to you to verify it works before you destroy 
your files.  Thrown together on the fly.... :)

# redundant loops, but it will work, I think....
# assumes you want to check every file in the current directly and
# below, regardless of type, either way
# it will remove all duplicates

for fn in $(find . -type f -print); do

	for fn1 in $(find . -type f -print); do

		if [ $fn == $fn1 ]; then continue; fi

		cmp -s $fn $fn1 && rm $fn1
	done
done

-- 
Until later, Geoffrey



More information about the Ale mailing list