how to batch rename the filename?
how to batch rename the filename?
How to batch rename the file name suffix with 'png'? the file name eg:A001.attach,A002.attach~A030.attach
- AlanBartlett
- Forum Moderator
- Posts: 9345
- Joined: 2007/10/22 11:30:09
- Location: ~/Earth/UK/England/Suffolk
- Contact:
how to batch rename the filename?
[code]
[b]for A in *.attach; do B=$(echo $A | sed 's/attach$/png/'); mv $A $B; done[/b]
[/code]
That will replace the "attach" suffix of every file with a "png" suffix.
If you would like to append a dot "png" suffix to every file, a simpler "for do done" construction can be used --
[code]
[b]for C in *.attach; do mv $C $C.png; done[/b]
[/code]
[b]for A in *.attach; do B=$(echo $A | sed 's/attach$/png/'); mv $A $B; done[/b]
[/code]
That will replace the "attach" suffix of every file with a "png" suffix.
If you would like to append a dot "png" suffix to every file, a simpler "for do done" construction can be used --
[code]
[b]for C in *.attach; do mv $C $C.png; done[/b]
[/code]
Re: how to batch rename the filename?
Or..
[code]
$ rpm -qf `which rename`
util-linux-2.13-0.59.el5.x86_64
$ rename .attach .png *.attach
[/code]
[code]
$ rpm -qf `which rename`
util-linux-2.13-0.59.el5.x86_64
$ rename .attach .png *.attach
[/code]
Re: how to batch rename the filename?
Thank you very much!
-
- Posts: 2
- Joined: 2016/05/11 19:26:21
Re: how to batch rename the filename?
How would i batch rename and change the number sequennce of a tiff sequence... ie
ThePicture_UHD_24p_98789976.tiff
ThePicture_UHD_24p_98789977.tiff
...
change that to
ThePicture_UHD_24p_98700000.tiff
ThePicture_UHD_24p_98700001.tiff
...
thanks!!
ThePicture_UHD_24p_98789976.tiff
ThePicture_UHD_24p_98789977.tiff
...
change that to
ThePicture_UHD_24p_98700000.tiff
ThePicture_UHD_24p_98700001.tiff
...
thanks!!