Over a million developers have joined DZone.

Rename Command Tips For Multiple Files

DZone's Guide to

Rename Command Tips For Multiple Files

Free Resource
add an extension to multiple files in different location:

$ EXT=`date "+%m%d%y.%H.%M"`
$ find . -type f -name "name" | xargs -i mv {} {}.$EXT

For example rename all *.bak file as *.txt, enter:
$ rename .bak .txt *.bak
Remove all blank space with rename command:
$ rename "s/ *//g" *.mp3
To remove .jpg file extension, you write command as follows:
$ rename 's/\.jpg$//' *.jpg
To convert all uppercase filenames to lowercase:
$ rename 'y/A-Z/a-z/' *

Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}