← Notes

How to batch rename files on a Mac without the Terminal

Finder can rename a thousand files at once, and most people never find the menu item. Here is what it does well, the four things it cannot do, and how to avoid the rename you cannot undo.

You have a folder of four hundred files called IMG_4471.JPG through IMG_4870.JPG, or Scan 12.pdf, Scan 12 copy.pdf, Scan 12 copy 2.pdf. Renaming them one at a time is an hour you are not getting back.

Almost everyone reaches for the Terminal at this point, or gives up. Neither is necessary for the common cases, because Finder has done this since OS X Yosemite and hides it behind a menu item nobody reads.

The built-in one, properly explained

Select the files. Right-click. The menu item says Rename N Items…. A small panel appears with a dropdown offering three modes.

Replace Text swaps one string for another across every selected name. Scan → Invoice- turns Scan 12.pdf into Invoice-12.pdf. This handles most of the "someone named these badly and consistently" cases.

Add Text puts a fixed string before or after the existing name. Useful for prefixing a project code, less useful than it sounds because it cannot insert anything variable.

Format is the one worth knowing. It throws away the old name and builds a new one from a base you type plus either an index, a counter, or the date. Kitchen -1.jpg, Kitchen -2.jpg, and so on. You choose where the number goes and what it starts at.

Two things that save grief:

  • Finder renames in the order the files are currently sorted in the window. Sort by date first if you want the numbering to follow chronology rather than the old alphabetical names.
  • Command-Z undoes the whole batch, but only until you do something else. It is not a safety net you should rely on.

For a lot of jobs, that is the end of the article. Genuinely — if you just need a folder of photos numbered sequentially with a sensible prefix, Finder does it in twenty seconds and you can close this tab.

Where it runs out

Four walls, and you hit them quickly.

It cannot read the file. Finder knows a file's name and nothing else. It cannot name a photo after the date it was taken, an audio file after its track title, or a PDF after the title in its document properties. All of that information is sitting inside the file, and Finder will not look.

It cannot do conditional or pattern work. "Rename these, but only the ones ending in -final." "Take the six digits in the middle and move them to the front." "Strip anything in brackets." These need patterns, and the Replace Text field is a literal string match.

It cannot show you the result before it happens. You type into the fields and the file list underneath does not preview the outcome. You find out what you did afterwards, which for four hundred files means scrolling and hoping.

It does not warn you about collisions. If two different files would end up with the same name, macOS resolves it by appending a number — so you get the rename you asked for plus a silent surprise. Worse, if a rename would overwrite something, you want to know before, not after.

The Terminal answer, and why it is a trap for most people

for f in *.jpg; do mv "$f" "new-$f"; done works. So does rename if you install it via Homebrew. If you are comfortable there, that is a perfectly good answer and you already knew it.

The reason it is a bad recommendation for most people is not difficulty — it is that mv has no undo, no preview, and no collision check. A typo in a glob can move four hundred files to one filename, and the first three hundred and ninety-nine are gone. Shell renaming is fine when you can predict exactly what a command will do. It is a poor place to experiment.

Before any bulk rename, whatever you use

  1. Have a copy. Time Machine, a duplicate of the folder, anything. This costs thirty seconds and occasionally saves a day.
  2. Test on ten files. Whatever your rule is, apply it to a small selection first and look at the result.
  3. Know your sort order, because tools that number files inherit it.
  4. Think about the collision case — what happens when two files want the same name?

Where RenameDeck fits

RenameDeck exists for the four walls above. It shows you the complete result list before anything is renamed, so you see every proposed name and can spot the one that is wrong. It detects invalid names and collisions, and it never overwrites an existing file.

It stacks rules — replacement, numbering, dates, case changes, templates — into recipes you can save and reuse, with literal, wildcard or regular-expression filters for the conditional cases. And it reads the file: dates, image metadata, media tags, PDF properties and parent folder names can all become part of the new name. For folders you process constantly, you can assign a frozen recipe to a watched folder.

It is local-first. The app is sandboxed with no network entitlement, so names and metadata are processed on your Mac and nothing leaves it. Journaled transactions mean an eligible batch can be undone properly rather than by memory and Command-Z.

None of which you need for numbering a folder of holiday photos. Use Finder for that.

Keep reading