I want to rename a bunch of files in one go. After Googling I got this: 

$ find -name "*.abc" -exec echo {} {} \; | sed -e "s/\.abc/\.def/" |
awk �{print $2 " " $1}� | xargs -n 2 -t mv
>mv ./sombrero.abc ./sombrero.def 
>mv ./steams.abc ./steams.def 
>mv ./sunset3.abc ./sunset3.def 
>mv ./swirlbox.abc ./swirlbox.def 
>mv ./smoke.abc ./smoke.def

It changes the file extention from .abc to .def ! 

OK, but instaed of simply changing the file extention from .abc to .def , I 
want .s01, .s02 ... .s12 etc. i.e. the pipe command should pick up first 
letter of the file-name ( "s" in this case ) and the rest 2 chars of file 
extention should have "01", "02" etc in increasing order for that particular 
letter.
The extention should be exactly 3-letter word in the above format. 

PS: I was thinking of doing it thru "C" , but this seems to be much easier 
trick. Good old Linux ! 


-------------------------------------------------------
This sf.net email is sponsored by: Jabber Inc.
Don't miss the IM event of the season | Special offer for OSDN members! 
JabConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to