Rename a bunch of files on a Mac (Linux too)

I misspelled a word when I exported a large group of photos from Aperture. I did not want to repeat the operation, so I renamed the files at a bash prompt in Terminal:

for FILE in * ; do NEWNAME=`echo $FILE | sed 's/oldstring/newstring/g' ` ; mv "$FILE" "$NEWNAME" ; done

Just change ‘oldstring’ [...]

share and enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Fark
  • Reddit
  • Slashdot
  • StumbleUpon
  • Twitter