Skip to content

Instantly share code, notes, and snippets.

@devynspencer
Last active October 22, 2015 20:29
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 devynspencer/b2f88a0528bc67612a9f to your computer and use it in GitHub Desktop.
Save devynspencer/b2f88a0528bc67612a9f to your computer and use it in GitHub Desktop.
Rename all files in folder with extension to md5 hash.
#!/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