here i found a very simple command flow to rename
the files in a folder by sequence order
i have list of *.png file with different names for example
Monsters-University-Icon-5.png
Monsters-University-James-P-Sullivan-Icon-2.png
.
.
i need to rename in to
Mon01.png
Mon02.png
.
.
here is a solutions
#!/bin/bash
a=1
for i in *.png; do
new=$(printf "Mon%02d" ${a})
mv ${i} ${new}
let a=a+1
done
it will do the magic..
the files in a folder by sequence order
i have list of *.png file with different names for example
Monsters-University-Icon-5.png
Monsters-University-James-P-Sullivan-Icon-2.png
.
.
i need to rename in to
Mon01.png
Mon02.png
.
.
here is a solutions
#!/bin/bash
a=1
for i in *.png; do
new=$(printf "Mon%02d" ${a})
mv ${i} ${new}
let a=a+1
done
it will do the magic..
Comments
Post a Comment