Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stmswitcher/880479dc5014c5888b59 to your computer and use it in GitHub Desktop.
Save stmswitcher/880479dc5014c5888b59 to your computer and use it in GitHub Desktop.
shell/bash rename multiple jpg files with random strings
#!/bin/bash
#rename each file with generated lowercase random 16 character alphanumeric string
for i in *.jpg; do mv "$i" "$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1).jpg"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment