Skip to content

Instantly share code, notes, and snippets.

@dayyan
Last active December 12, 2015 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dayyan/4725966 to your computer and use it in GitHub Desktop.
Save dayyan/4725966 to your computer and use it in GitHub Desktop.
find . -name '*.*' -type f -print | while read file; do
hash=$(sha1sum $file | awk '{print $1}');
mkdir -p hashed;
cp $file hashed/${file%.*}-$hash.${file/*.};
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment