Last active
September 18, 2015 15:19
-
-
Save bblanchon/d1869a7418d3067984d1 to your computer and use it in GitHub Desktop.
Compute checksums of files in each folder recursivlty
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
find $(pwd) -type d | while read DIR | |
do | |
cd $DIR | |
FILES=$(find -maxdepth 1 -type f -not -name '*SUMS' -printf '"%f"\n' | sort) | |
FILE_COUNT=$(echo $FILES | wc -c) | |
if [ -z "$FILES" ] | |
then | |
rm -f *SUMS | |
else | |
echo $FILES | xargs md5sum > MD5SUMS | |
echo $FILES | xargs sha1sum > SHA1SUMS | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment