Created
July 7, 2015 08:02
-
-
Save zouzias/9ceff2b666edd32707e1 to your computer and use it in GitHub Desktop.
MD5: Check md5 of all files from a directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check md5 from all files in a dir. It assumes that for each file "filename.txt" there exists a "filename.txt.md5" corresponding file | |
FILES=`ls *` | |
for f in $FILES | |
do | |
# echo "Processing $f" | |
MD5=`md5 $f` | |
TRUE_MD5=`cat $f.md5` | |
if [ "$MD5" == "$TRUE_MD5" ]; | |
then | |
echo "File $f : OK"; | |
else | |
echo "MD5 is NOT valid on file $f" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment