Skip to content

Instantly share code, notes, and snippets.

@simbamangu
Created April 27, 2020 13:06
Show Gist options
  • Save simbamangu/2badd9147297c98feb99e3227b5aacdc to your computer and use it in GitHub Desktop.
Save simbamangu/2badd9147297c98feb99e3227b5aacdc to your computer and use it in GitHub Desktop.
Rename a file with UUID and extension
#!/bin/bash
# Rename a file with a UUID, preserve the extension.
# Usage:
# mvuuid.sh TEST.JPG
# Output example:
# 887D830A-AE74-4835-8990-760908125E0B.JPG
mv $FILE `uuidgen`."${FILE##*.}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment