Linux/OSX mass file renaming
by volve on Jan.22, 2008, under linux
A handy command-line of text to mass rename files (in this case, change file extensions) that works in Linux and OSX:
ls -d *.cbz | sed 's/\(.*\).cbz$/mv -v "&" "\1.cbr"/' | sh
In this example, all .cbz files are renamed to .cbr (as I noticed some comic book archives I had were wrong).
An even more concise version using ‘basename’ was mentiond but OSX seems to have different default extension handling.
[via http://6v8.gamboni.org/Mass-renaming-with-linux-shell.html]