Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rename a bunch of files by zero padding
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
You can’t perform that action at this time.