Skip to content

Instantly share code, notes, and snippets.

@simbamangu
Last active May 11, 2020 18:10
Show Gist options
  • Save simbamangu/d5550dc1b8be047355106fd3145d9e41 to your computer and use it in GitHub Desktop.
Save simbamangu/d5550dc1b8be047355106fd3145d9e41 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 $1 `uuidgen`."${1##*.}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment