Created
May 30, 2020 00:07
-
-
Save luckylittle/59bc20d5172413c666841e96c04b9647 to your computer and use it in GitHub Desktop.
Bash script to randomize filenames (to 6 alphanumeric characters)
This file contains 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 | |
for x in $(ls -1); do mv {${x},$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)}; done | |
# Before: | |
# ~ ls | |
# ~ IMG_20200522_225920.jpg IMG_20200522_230114.jpg IMG_20200522_230302.jpg | |
# After: | |
# ~ ls | |
# ~ 14pkJd 4ld2t9 6foTRm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment