Blog · How-to

How to rename multiple files on a Mac

Finder can rename a whole batch in one go. The three built-in options with worked examples, Automator and Shortcuts, a safe Terminal loop, and how to undo a rename.

Updated 7 min readBy the Leo Commander team

To rename multiple files on a Mac, select the files in Finder, Control-click one of the selected files and choose Rename. Finder's Rename panel can replace text in every name, add text before or after each name, or give the whole batch a new name with an index, counter or date. Click Rename and every selected file changes at once.

Key names used below, for anyone new to a Mac keyboard: Command is ⌘, Option is ⌥, Shift is ⇧ and Control is ⌃.

How to rename multiple files at once on Mac in Finder

  1. Select the files. Hold ⌘ or ⇧ while clicking to add files to the selection, or press ⌘A to select the whole folder.
  2. Control-click (or right-click) one of the selected files.
  3. Choose Rename from the shortcut menu.
  4. In the pop-up menu below Rename Finder Items, choose Replace Text, Add Text or Format.
  5. Fill in the fields for that option, as described below.
  6. Click Rename.

For a single file, select the file, press Return, type the new name and press Return again. Apple's guide to renaming files, folders and disks covers both methods.

Rename files in Finder: the three options

Replace Text

Type the text to remove in the Find field and the new text in the "Replace with" field. Finder swaps one for the other across the selected names. Use it to fix the same typo in 40 filenames or to change a camera prefix.

Add Text

Type the text, then choose whether it goes before or after the current name. Good for a client name, a project code or a date you type yourself.

Format

Choose a name format, then choose whether the index, counter or date goes before or after the name. Type a base name in the Custom Format field and the number to start with. Format builds the new names from your Custom Format text plus a number or date, so pick it when the old names carry nothing worth keeping.

Batch rename examples

Turn IMG_0001.jpg into Trip-0001.jpg

Say a folder of photos runs from IMG_0001.jpg to IMG_0240.jpg. Select all of the photos, choose Replace Text, type IMG_ in Find and Trip- in Replace with. IMG_0001.jpg becomes Trip-0001.jpg, IMG_0002.jpg becomes Trip-0002.jpg, and the original numbers don't change, so the order holds.

Add a client name to every file

Select the PDFs for one client, choose Add Text, type the client name followed by a space (Acme, for example) and choose before the name. Invoice.pdf becomes Acme Invoice.pdf.

Number a batch from 1

Choose Format, type Lisbon in Custom Format, put the index after the name and start at 1. Every file gets Lisbon plus a number, counting up from 1. Apple's guide doesn't spell out the exact spacing or digit count, so try the rule on two duplicates first: select the files and press ⌘D to duplicate the selection.

Batch rename files on Mac with Automator or Shortcuts

If you rename files the same way every week, save the steps as a Quick Action. Apple's Finder help says both the Shortcuts app and Automator can add items to Finder's Quick Actions menu, which opens when you Control-click a file.

Automator

Apple's Automator User Guide still covers macOS 27, and a Quick Action workflow is available from Finder windows, the Services menu and the Quick Actions menu.

  1. Open Automator, choose File > New, select Quick Action and click Choose.
  2. At the top of the workflow area, set the input to files or folders and the app to Finder.
  3. Type "Rename" in the Library search field, then double-click Rename Finder Items to add the action.
  4. Choose a mode and fill in the settings.
  5. Choose File > Save and name the Quick Action.

Apple's own Automator tutorial for photographers builds a numbered renamer from this action: Make Sequential, a new name, and every number made 3 digits long.

Shortcuts

The Shortcuts app can take over from Automator. Drag an Automator workflow file into Shortcuts and, according to Apple, most workflows convert into a shortcut automatically. To put any shortcut in Finder's Quick Actions menu:

  1. In Shortcuts, double-click the shortcut, open Details and select Use as Quick Action.
  2. Choose Apple menu > System Settings > Privacy & Security > Extensions > Finder, then turn on the shortcut. On macOS 12, choose System Preferences, click Extensions, select Finder and select the shortcut.
  3. Control-click files in Finder, choose Quick Actions, then your shortcut.

Apple's Shortcuts guide has the full setup. You may not need to build anything: in a story written for macOS Sonoma, Apple's App Store editors pointed Mac users to a ready-made Gallery shortcut called Rename Files, which adds or replaces text in filenames. Search the Gallery for it before you start from zero.

Rename multiple files on Mac with Terminal

For a bulk rename on a Mac with a rule Finder can't express, a short loop in Terminal does the job. New user accounts have used zsh as the default shell since macOS 10.15, and this example is written for zsh.

Start with a dry run. The first line opens the folder; the second prints each rename instead of doing it:

cd ~/Pictures/Trip

for f in IMG_*.jpg; do echo mv -n "$f" "Trip-${f#IMG_}"; done

Read the output. Each line shows the old name, then the new one, such as mv -n IMG_0001.jpg Trip-0001.jpg. If the whole list looks right, run the same loop without echo:

for f in IMG_*.jpg; do mv -n "$f" "Trip-${f#IMG_}"; done

How the loop works: ${f#IMG_} strips IMG_ from the start of each name, and -n tells mv never to overwrite a file that already exists. Keep the quotes exactly as shown. mv has no undo, which is why the dry run comes first. To reverse this example, swap the two prefixes:

for f in Trip-*.jpg; do mv -n "$f" "IMG_${f#Trip-}"; done

How to undo a rename on Mac

In Finder, press ⌘Z straight after the rename, before you do anything else. Apple's keyboard shortcut list gives ⌘Z as Undo for the previous command and ⇧⌘Z as Redo.

Too late for that? Run the rename in reverse. After replacing IMG_ with Trip-, select the same files and replace Trip- with IMG_. Apple's own advice for a rename that causes trouble is the same: change the name back.

Apple documents no undo for Automator or Shortcuts renames, and mv in Terminal has none either. Test Automator, Shortcuts and Terminal renames on duplicates first.

Where Finder's rename tool falls short

  • One operation per pass. The pop-up menu offers Replace Text, Add Text or Format, so adding a prefix and fixing a word in the same names takes two runs.
  • Apple documents the three options and nothing else. Changing letter case or matching a pattern needs Terminal or a multi-rename tool.
  • Apple's guide describes no list of before-and-after names, so try a new rule on copies.
  • A name can't contain a colon (:) or start with a period, and some apps reject a slash (/).
  • Leave extensions alone. Apple warns that changing an extension such as .jpg may stop the file opening in the app that created it. Apple also advises against renaming app folders, system items such as the Library folder, and your home folder.

Multi-Rename in Leo Commander Pro

On Windows, Total Commander users press Ctrl+M for the Multi-Rename Tool (see our list of Total Commander shortcuts on Mac). Leo Commander, a Total Commander alternative for Mac, has the counterpart: Multi-Rename with a live preview, part of Leo Commander Pro. You see the new names before any file changes.

Marking files works the Total Commander way: Insert or ⇧↓ marks a file and moves to the next one. The rest of the window will look familiar too, with two panels, the F-key bar and the Total Commander menu names (Files, Mark, Commands, Net, Show, Configuration, Start, Help).

Leo Commander Pro costs $10 once, tax included, with free updates for life. Besides Multi-Rename, Pro adds Synchronize Directories (see how to sync two folders on Mac), Branch View, FTP, SFTP and WebDAV servers in a panel (copy only), and custom keyboard shortcuts. The free version handles daily file work: F5 copy, F6 move (more in how to cut and paste files on Mac), tabs, Favorites and Find Files. Compare Free and Pro before you decide.

Other Mac file managers rename in bulk too. In our 25-point comparison from November 7, 2026, CRAX Commander, ForkLift, Path Finder and Bloom include a multi-rename tool, QSpace Pro sells its advanced batch rename as a paid extension, and Commander One's feature list has none. For the switch from Windows as a whole, read the Total Commander alternative for Mac guide.

Which batch rename method to use

MethodBest forUndoPreview
Finder RenameReplacing or adding text, simple numbering⌘Z right afterNone documented by Apple; test on copies
Automator Quick ActionThe same rename, repeated from FinderNone documentedNone documented; test on copies
Shortcuts Quick ActionReusable renames and imported Automator workflowsNone documentedNone documented; test on copies
Terminal loop (zsh)Rules Finder can't express, large foldersNone; run a reverse loopFull list with an echo dry run
Leo Commander Pro Multi-RenameTotal Commander habits, checking every name firstCheck the live preview before renamingLive preview

Sources

Checked November 8, 2026. Leo Commander is an independent app, not affiliated with Ghisler Software GmbH or Apple Inc.

Questions

Frequently asked questions

Can you rename multiple files at once on a Mac?

Yes. Finder has a built-in batch rename. Select the files, Control-click one of the selected files and choose Rename. The panel offers three options: Replace Text, Add Text and Format. Every selected file is renamed when you click Rename, so simple jobs need no extra app.

How do I rename files with sequential numbers on a Mac?

In Finder's Rename panel, choose Format. Pick a name format, choose whether the index, counter or date goes before or after the name, type a base name in Custom Format and set the starting number. Try the rule on two duplicates first to see the exact pattern. Automator's Rename Finder Items action also has a Make Sequential mode.

How do I undo a batch rename on a Mac?

Press Command-Z in Finder right after renaming, since Apple lists Command-Z as Undo for the previous command. If you have already done other work, reverse the rename with the same tool, for example by running Replace Text again with the Find and Replace with values swapped. Terminal renames with mv have no undo, so do a dry run first.

Can Finder rename files using patterns or regular expressions?

Apple's guide documents three options for renaming multiple items: replace text, add text and change the name format. Nothing in the guide covers patterns, wildcards or letter case. For pattern-based renames, use a Terminal loop with zsh parameter expansion, or a file manager with a multi-rename tool, such as Multi-Rename with a live preview in Leo Commander Pro.

Is Automator still available on macOS?

Apple's Automator User Guide still lists macOS 27, and Automator can save a Quick Action that appears in Finder. Apple also lets you import Automator workflows into the Shortcuts app: drag the workflow file into Shortcuts and most workflows convert automatically. Shortcuts can then add the result to Finder's Quick Actions menu.

How do I rename multiple files in Terminal on a Mac?

Use a for loop in zsh, the default shell for new accounts since macOS 10.15. For example, for f in IMG_*.jpg; do mv -n "$f" "Trip-${f#IMG_}"; done swaps the IMG_ prefix for Trip-. Put echo before mv on a first run to print the renames without doing anything, and keep -n so no existing file gets overwritten.

Does Leo Commander have a multi-rename tool like Total Commander?

Yes. Leo Commander Pro includes Multi-Rename with a live preview, the counterpart of the Multi-Rename Tool that Total Commander opens with Ctrl+M on Windows. Pro costs $10 once, tax included, with free updates for life, and also adds Synchronize Directories, Branch View, FTP, SFTP and WebDAV servers in a panel (copy only) and custom keyboard shortcuts.

Try Leo Commander for Mac.

Start with Free for two-pane file management. Pro adds advanced tools and lifetime updates for a one-time $10 payment.