Created
May 30, 2016 05:33
-
-
Save guillaumewuip/78eca8a9d02f21f183039ef484c83f5b to your computer and use it in GitHub Desktop.
Rename pictures in directory with 001.JPG, 002.JPG ... if they were named 1.JPG 2.JPG, ...
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
FILES=./*.JPG | |
for f in $FILES | |
do | |
filename=`basename $f`; | |
filename="${f%.*}" | |
filename="${filename#./}" | |
newFilename=`printf "%03s\n" $filename`; | |
echo $newFilename.jpeg; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment