Renaming many files in Mac OS X, batch processing
Solution 1:
With Homebrew, a package manager for OS X:
brew install rename
Then you can run the same rename
commands as in Linux.
Solution 2:
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.
Solution 3:
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
Solution 4:
You can try to install MacPorts and install the renameutils
package:
renameutils @0.10.0 (sysutils)
renameutils is a set of programs designed to make renaming files faster and less cumbersome