Some examples how I renamed easily many files:
Say that you have the following files:
that need to be changed to:
This can be done by the following command:
Second example: you want to remove the "_" from the beginning of the name of the files
Third example : from the files named
to
This can be done by:
Say that you have the following files:
pipp.1
pipp.2
...
pipp.2
...
that need to be changed to:
PPP_1
PPP_2
...
PPP_2
...
This can be done by the following command:
for i in $(ls pipp*); do a=$(echo $i | cut -d'.' -f2); echo $a; mv $i PPP_$a; done
Second example: you want to remove the "_" from the beginning of the name of the files
_img000336.bmp
...
_img000337.bmp
This can be done by:...
_img000337.bmp
for i in `seq 336 599`; do mv _img000$i.bmp img000$i.bmp ;done
Third example : from the files named
01author.mp3
02author.mp3
...
02author.mp3
...
to
author01.mp3
author02.mp3
...
author02.mp3
...
This can be done by:
for i in $(ls); do b=$(echo $i | cut -c 1,2); mv $i author$b.mp3; done
No comments:
Post a Comment