Monthly Archives: November 2011

You are browsing the site archives by month.

Rename Multiple Files In Debian or *nix

Obviously the n00b trick of trying to do

mv oldName* newName*

does not work.

Interestingly I just found that Debian has a “rename” command that supports perl regular expressions. So this would work in case you were wondering how:

rename 's/^oldName/newName/' oldName*

Replace spaces in the filenames with “_”:

rename 's/\ /_/g' *

Check your man pages before you attempt this on a different *nix system. Different rename binaries might have different functionality.