Created
March 20, 2018 16:43
-
-
Save ivan-krukov/6a8c1e0fd8d4961b664c8b952a7a9df2 to your computer and use it in GitHub Desktop.
Rename a bunch of files by zero padding
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
N=100 | |
# create | |
for ((i = 1; i <= N; i++)); do | |
touch e-$i.csv | |
done | |
# rename | |
# note %04d - pad to 4 zeros | |
for ((i = 1; i <= N; i++)); do | |
mv e-$i.csv $(printf e-%04d.csv $i) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment