[Nottingham] Batch file renaming

Michael Erskine msemtd at googlemail.com
Sun Jul 20 19:08:18 BST 2008


> find musicdirroot/. -type d -exec rename ".128kbps" "" *.128kbps \;
>
> (Mmmm... Or would the bash globbing muck that up?)

Probably, better man rename - since this is in effect executing a
given Perl expression with $_ for each globbed argument, I tend to use
things like...
rename 's/this/that/g' *.whatever
... or ...
rename 'tr/[A-Z]/[a-z]/' *.something
... or ...
rename 'ucfirst' *.things

Regards,
Michael Erskine.



More information about the Nottingham mailing list