$ find . -exec bash -c "mv '{}' '\`echo {} |sed -e 's/foo/bar/g'\`"' \;

This command is a more flexible than my previous submission.

It will work with spaces however suuuuper hacky and ugly.

Source: http://www.unix.com/shell-programming-scripting/146173-find-rename-files-using-find-mv-sed.html

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Tags: