Created
April 2, 2015 19:57
-
-
Save soltrinox/70f36acdb59bdd3864c6 to your computer and use it in GitHub Desktop.
rename files in BASH shell to sequence
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/bash | |
| 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