Skip to content

Instantly share code, notes, and snippets.

@Thermionix
Created May 30, 2012 06:52
Show Gist options
  • Save Thermionix/2834154 to your computer and use it in GitHub Desktop.
Save Thermionix/2834154 to your computer and use it in GitHub Desktop.
recursively check or generate md5 checksums for a folder
#!/bin/bash
cd ../iso/
for f in `find . -type f -not -name "*.md5" -printf "%f\n"`
do
if [ -f ${f}.md5 ]
then
md5sum -c $f.md5
#| grep FAILED$ > failed_hashes
#diff <( cat $f.md5 ) <( md5sum $f )
else
md5sum $f > $f.md5
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment