Renaming multiple files in multiple directories.

Geert Janssens yellowdog-general@lists.terrasoftsolutions.com
Sat, 18 Sep 2004 09:14:43 +0200


Patrick Smith wrote:
> 
> (Warning: I have not tested this.  Also, it assumes you don't have any 
> files with ogg.ogg in the middle.)
> 
> find /home/user/oggs -name '*ogg.ogg' -print0 \
> | xargs -0 rename ogg.ogg .ogg

Impressive ! Only this week I wrote some clarification for the rename 
command to this list and here it goes, used in a powerfull 
unix/linux-worthy solution I could not possibly have imagined!

And while we're at it, I just learned of a new command: xargs.
Thanks, it will no doubt come in handy in the future :-)

Cheers,

Geert