Renaming many files in Mac OS X, batch processing

With Homebrew, a package manager for OS X:

brew install rename 

Then you can run the same rename commands as in Linux.


Use the power of ZSH wisely (type zsh in the terminal if you are one of those poor souls who don't use it by default):

autoload zmv
zmv '(*).htm' '$1.html'

ZMV follows MMV syntax.


Clumsy me:

for i in *.yourfiles; do mv "$i" "`echo $i | sed 's/old/new/g'`"; done 

And if you want to use it like I do often this way:

rename 's/old/new/' *.files

I recommend to use this litte script in ~/bin/rename:

#!/usr/bin/env zsh
SUBSEXPR=$1
shift
for i in $@; do mv $i `echo "$i" | sed $SUBSEXPR`; done