Tuesday, February 08, 2011

Find and Rename files in Linux

I had to rename many files (in particular their extensions) which were spread throughout many folders.

I already knew find and rename utilities but I had never used them together...

here's the command line to rename all files in all the folders of the current directory with extension .first to .second

find . -name "*.first" -exec rename -v 's/\.first$/\.second/' {} +

hope this helps :)


Diego said...

hope this helps ????

This helps pra caralho!!!


betto said...

I don't know what you mean, but I hope this helped :)