How to rename multiple files at once?

Solution 1:

Try something like this:

 for file in Picture*.jpg
 do
    mv "$file" "vacation-$file"
 done  

(open terminal and add one line {press Enter} at a time.)

What that does is uses the variable file for each entry matching Picture*.jpg. Then it takes the file or folder and moves it to be prefixed with "vacation".

Hope that helps

Solution 2:

No need for command line...

  1. Add all the images to be renamed into a folder.
  2. Select all files, right click mouse and select "Rename x items"
  3. Select "Add text" from first drop down menu
  4. Select "Before name" from the second drop down menu
  5. Enter "Vacation_" into the text box (without the quotation marks)
  6. Press Enter.

Solution 3:

brew install rename

rename s/config\./route\.config\./g *

First you need homebrew installed. Then install rename, and the above regex renames all files with "config." to "route.config".

So say files config.a.js, and config.b.js -> route.config.a.js, route.config.b.js.

Solution 4:

While not a Terminal solution, I like Forklift for this purpose (and for many others). From their website:

Forklift's Multi-rename feature description

Solution 5:

I like user933531's answer, but if you'd like a GUI, the A Better Finder Rename app is really good. I got it from the App Store.