Batch renaming files

I needed to batch rename some files

brew install rename

To test run it

rename -n -e 's/-.*-/_/'  *.png

Remove the -n to perform it

rename -e 's/-.*-/_/'  *.png

I wanted to remove the following -portrait

rename -d -portrait *

Thanks to

http://stackoverflow.com/questions/24102974/mac-os-x-terminal-batch-rename

http://superuser.com/questions/398709/mass-remove-file-prefix-on-a-mac

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: