rename file with a pattern
Hi
i have a lot of file named like xxxx.doc.pdf i want to rename all the file in to xxxx.pdf i hope a script will help me to do the job all the files contain in a directory Thanks in advance Sujith.V.S |
Install the "mmv" (Multiple Move) package, and read its man page.
|
Must admit that mmv is probably the best way, if you want to 'write your own':
for THIS in *doc.pdf do echo ${THIS} ${THIS%%.doc.pdf}.pdf done replace echo with mv, cp whatever. |
Hey, I've been wondering about this too, but where do you find mmv? All I can find on google are links to the Debian site.
|
http://www.google.co.nz/linux?hl=en&...a=lr%3Dlang_en
Odd ... no mention of Debilian in the first 10 hits ... Cheers, Tink |
See also this:
http://wiki.linuxquestions.org/wiki/Mmv |
"Odd ... no mention of Debilian in the first 10 hits ..."
Yeah, but that's the New Zealand google, check out US google: http://www.google.com/search?q=mmv&s...en-US:official EDIT: Dammit, forgot about Linux google... |
Quote:
Just to please you ... and still no mention of debilian. Cheers, Tink |
All times are GMT -5. The time now is 08:56 PM. |