Batch change of extension

smolz

Registered
is there a way to change the extension of a bunch of files, i am guessing using a terminal command. What I want is that I have .m4a files that I want to change to .m4b so I can bookmark them.
 
for file in `ls *.m4a`; do mv $file `basename $file .m4a`.m4b; done

That will work in one directory; it won't recurse down subdirectories. You'd need to use find for that instead of just looping through the results of ls. Wouldn't be hard, but I'm too sleepy to look up the syntax.
 
One really easy way to do it is to use Automator. There are numerous ways to go about it in Automator, depending on what works best for you. One way to do it is to use two Finder actions:

1) Ask for Finder Items (with Allow Multiple Selections checked)
2) Rename Finder Items (Replace Text in Finder Item Names)

When you run it, select the items you want to change and that's it. Alternatively, you could replace Ask for Finder Items with Get Specified Finder Items and specifically drag and drop everything you want to change right into the window.

In either case, a piece of cake.
 
Shareware prog SkoobyRenamer will be of benefit here - (and in a multitude of other situations too :).
 
Back
Top