bash - rename multiple files in shell script -
rename multiple files...in shell
i have 3 files in dir
abc.tar.gz abc2.tar.gz abc3.tar.gz
using command :
rename abc abc.part abc*.tar.gz
it converts them into
abc.part.tar.gz abc.part2.tar.gz abc.part3.tar.gz
after added 3 more files in it..
abc.tar.gz abc2.tar.gz abc3.tar.gz
and when fire rename abc abc.part abc*.tar.gz
it rename 6 files final output
abc.part.tar.gz abc.part.part2.tar.gz abc.part.part3.tar.gz abc.part.part.tar.gz abc.part2.tar.gz abc.part3.tar.gz
i want prevent multiple rename... should rename
command?
means final output should below,no matter how time fire rename command. here number of files dynamic
..it 3,4...or whatever... cannot add statically 3 or number !!
abc.part.tar.gz abc.part2.tar.gz abc.part3.tar.gz
as final argument rename, use:
abc{,2,3}.tar.gz
Comments
Post a Comment