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’ and ‘newstring’ to the values needed.

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

Leave a Reply

  

  

  


*

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>