Skip to content

Instantly share code, notes, and snippets.

@icaoberg
Created July 16, 2013 04:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icaoberg/6005782 to your computer and use it in GitHub Desktop.
Save icaoberg/6005782 to your computer and use it in GitHub Desktop.
[BASH] Rename all files in the current folder using a universally unique identifier (UUID)
#!/bin/bash
for FILE in *
do
if [ -f "$FILE" ];then
ID=`uuidgen`
EXTENSION=${FILE#*.}
mv -v "$FILE" "$ID"."$EXTENSION"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment