21 05/2015

batch rename 2 sequential numbers.md

最后更新: Thu May 21 2015 13:03:17 GMT+0800

a=1
for i in *.jpg; do
new=$(printf “%04d.jpg” “$a”) #04 pad to length of 4
mv — “$i” “$new”
let a=a+1
done