Mac OS X – Rename a bunch of files quickly

Let’s say I have a bunch of files with the extension “.abc” and I want to change all of them to end with “.doc”.  I can rename each one individually in the Finder, but that could take a long time if there are a lot of files.  Especially considering the warning the Finder gives you about changing the file extension.

A much faster way to do it is to launch the Terminal application, “cd” to the directory where your files exist, and use this command:

for f in *.abc; do mv ./”$f” “${f%abc}doc”; done

All of  your “*.abc” files will be changed to “*.doc”.