Last active
October 22, 2015 20:29
-
-
Save devynspencer/b2f88a0528bc67612a9f to your computer and use it in GitHub Desktop.
Rename all files in folder with extension to md5 hash.
This file contains 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 | |
local extension=$1 | |
for f in $(pwd)/*.$extension; do | |
local hash=$(md5 -q $f) | |
echo "renaming $f to $hash.$extension" | |
mv "$f" "$hash.$extension" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment