First … go the catalog that needs to be indexed
Execute command to find all pictures between 200k and 100M *jpg *nef and write output to file
Important is the “{}”
Important is also the md5 -r that puts the 32 bit MD5 sum in the front of the line.
find . -iname “*.jpg” -or -iname “*.nef” -size +200k -size -50M -exec md5 -r “{}” \; | sort > allhashes.txt
find . -name “*.jpg” -exec md5 -r “{}” \; | sort > allhashes.txt <——— this one works !!!!!
find . \( -iname \*.jpg -o -iname \*.jpeg -o -iname \*.nef -o -iname \*.cr2 \) -size +200k -size -50M -exec md5 -r “{}” \; >> allhashes.txt
find . \( -iname \*.jpg -o -iname \*.jpeg -o -iname \*.nef -o -iname \*.cr2 \) -size +200k -size -50M -exec md5 -r “{}” \; >> allpictures_hashed_2.txt
This will take all hashes and only present the unique one
cut -c -32 allhashes4.txt | uniq > allhashes_uniq.txt
This one doesn’t work as I wanted
cut -c -32 allhashes.txt | uniq | grep -f /dev/stdin allhashes.txt
This one returns only the unique results, to file
cat allhashes4.txt | grep -f allhashes_uniq.txt | awk -F” ” ‘!_[$1]++’ > sorted6.txt
1. Find all pictures in subfolders and display their hash and file path in file
find . \( -iname \*.jpg -o -iname \*.jpeg -o -iname \*.nef -o -iname \*.cr2 \) -size +200k -size -50M -exec md5 -r “{}” \; >> allpictures_hashed_2.txt
2. This will take all hashes and only present the unique one
cut -c -32 allhashes4.txt | uniq > allhashes_uniq.txt
3. Returns only the unique results, to file
cat allhashes4.txt | grep -f allhashes_uniq.txt | awk -F” ” ‘!_[$1]++’ > sorted6.txt
Really good reference website here:
Cut command
More exiftool commands
Find big files
Save terminal output to file
MD5 in terminal