Created
January 12, 2019 14:15
-
-
Save Jamiewarb/c0a42af70b19d1a5a0699fa57da202c8 to your computer and use it in GitHub Desktop.
Rename all files in a directory with a sequential numerical prefix/suffix
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
#ls | cat -n | while read n f; do mv -n "$f" "FILENAME-$n.extension"; done | |
#e.g. | |
ls | cat -n | while read n f; do mv -n "$f" "rheinbacher-premium-beissbier-$n.jpg"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment