[thelist] bulk rename on Mac

Alejandro E. Ramos Castro alk_ranksor at mac.com
Tue Nov 23 13:52:57 CST 2010

Hello Joel,

There are many ways to accomplish that.

The first one is an AppleScript that may be already included on your computer, if it is, is located inside "/Library/Scripts/Finder Scripts" and is named "Replace Text in Items Names". To use it is necessary to activate the AppleScript menu in the Menu Bar, you can do this using the "AppleScript Editor" and opening the Preferences, in the "General" section in the bottom is the option "Show Script Menu in menu bar".

Once activated select the window with your files and got to the new menu in the right side, select the script and in a few moments the task will be done.

On the commercial front there is an Application named "A Better Finder Rename", from the name is obvious what is it for.

And finally in the Terminal. Instead of trying of mv everything to the new name you must iterate through all the items and rename the one by one. Try this:

for i in `ls -1 *.asp` ; do mv $i `echo $i | sed 's/\.asp/.php/g'` ; done

What it does is list all ".asp" items and use then in a 'for' loop, then it will mv the original name to a new e (the 'sed' that searches the string .asp and replaces it for .php).

Hope this helps.

Greetings from Mexico.

Alex Ramos.

On 2010-11-23, at 13:20, Joel D Canfield wrote:

> I have a folder packed with .asp files which I need to rename .php (yes, I
> changed the code inside already)
> mv *.asp *.php in Terminal seems like it should work, but only throws an
> error (well, not really, it just spits back "here's how to use mv")
> what's the obvious thing I'm missing?
> -- 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt ! 

More information about the thelist mailing list