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 | No comments

No comments yet. Be the first.

Leave a reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word