Last active
March 29, 2016 20:58
-
-
Save victorkristof/14271e7f71b64e177f2ee33910591d07 to your computer and use it in GitHub Desktop.
Rename all files in a directory with sequential numbers
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
find . -name '*.jpg' | # find jpegs | |
awk 'BEGIN{ a=1 }{ printf "mv \"%s\" %02d.jpg\n", $0, a++ }' | # build mv command | |
bash # run that command | |
# Source: http://stackoverflow.com/a/10780250/2086547 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment