Skip to content

Instantly share code, notes, and snippets.

@MJafarMashhadi
Created October 14, 2016 07:28
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 MJafarMashhadi/19a8df846547ac42f8caa830336973ed to your computer and use it in GitHub Desktop.
Save MJafarMashhadi/19a8df846547ac42f8caa830336973ed to your computer and use it in GitHub Desktop.
#!/bin/sh
md5sum * 2>/dev/null | cut -c 2-3 | uniq | xargs mkdir
for f in *; do
if [ -f $f ]; then
mv "$f" $(md5sum "$f" | cut -c 2-3)
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment