Forked from earthgecko/bash.generate.random.alphanumeric.string.sh
Last active
December 21, 2015 15:59
-
-
Save stmswitcher/880479dc5014c5888b59 to your computer and use it in GitHub Desktop.
shell/bash rename multiple jpg files with random strings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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