Created
March 8, 2013 13:56
-
-
Save benvium/5116590 to your computer and use it in GitHub Desktop.
Rename all PNG files in the current directory to have numbers e.g. 0001.png 0002.png.
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/sh | |
| a=1 | |
| for i in *.png; do | |
| new=$(printf "%04d.png" "${a}") #04 pad to length of 4 | |
| mv "${i}" "${new}" | |
| let a=a+1 | |
| done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment