Jason Sares is a Giant Dork

Little Quick Tip – Rename Multiple Files

I used to use mv in a for loop or with exec, or xargs until I found a very useful command that’s included in almost every distro

rename

Usage

$ rename oldfilename newfilename *filepattern

Example

To rename all the files in the current directory ending with .htm to .html

$ rename .htm .html *.htm

You can use RegEx and for more sophisticated selections and use -n to test your changes before you commit them.

Posted in Linux Quick Tip | Comments are off for this post

Comments are closed.