Created
March 31, 2020 07:56
-
-
Save nightcrawler-/1678348d47ec521aaf03aa6e8e4d3586 to your computer and use it in GitHub Desktop.
Rename all PNG files in directory sequentially from 1, pad to x length
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
a=1 | |
for i in *.png; do | |
new=$(printf "%04d.png" "$a") #04 pad to length of 4 | |
mv -i -- "$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