everyday mac tools

Rename a batch of files at once on a Mac with Finder

· 6 min read

Finder has a batch renamer built in. Select the files, right-click any one of them and choose Rename. With several files selected, the window that opens offers three modes: replace text in every name, add text to every name, or give them all a new name with a number. Click Rename, and if the result is wrong, Command-Z puts every name back.

That covers most jobs, from tidying a folder of camera files to numbering scanned pages. The sections below go through each mode, the order the numbers run in, and the cases where you need something else.

Select the right files first

The renamer works on whatever is selected, so the selection is half the job.

  • Command-A selects everything in the window.
  • Command-click adds or removes single files.
  • Shift-click in list view selects a run of files between two clicks.

You are not limited to one folder. Run a Finder search (Command-F), select the matching files in the results, and the renamer handles them all, even though they live in different places.

Two things are worth doing before you start. First, sort the window the way you want any numbering to run, by Date Created for photos or by name for scans. Second, make sure you can see file extensions, so you know exactly what each name contains: Finder, Settings, Advanced, Show all filename extensions. Show file extensions for every file on a Mac explains why that setting matters beyond renaming.

The three modes

Choose a mode from the pop-up menu at the top left of the Rename window. An example at the bottom shows what the first file will be called before you commit.

Replace Text. Type what to find and what to put in its place. Find IMG_ and replace it with Lisbon and IMG_4021.jpeg becomes Lisbon 4021.jpeg. Leave the replacement empty to delete the text from every name. Replace Text matches anywhere in the name, so check the example if the text you are replacing is short enough to appear somewhere you did not intend.

Add Text. Type text and choose before name or after name. This suits prefixes such as 2026-10 or suffixes such as signed. The extension stays where it is.

Format. This replaces the names entirely. Choose a name format, then type a base name in Custom Format and choose where the number goes and what to start from:

  • Name and Index adds 1, 2, 3 and so on.
  • Name and Counter adds numbers padded with zeros, so they sort correctly past 9 and 99.
  • Name and Date adds a date and time, but it is the time you rename, not the date each file was made. That surprises people renaming photos, so see the photo section below.

With Format, check the first few results after renaming. If the numbering runs in an order you did not expect, undo, sort the window differently, select again and repeat.

Undo, and the limits Finder enforces

Choose Edit, Undo Rename, or press Command-Z, straight after renaming and every file gets its old name back in one step. Do it before you start moving or editing the files.

Finder will not give two files in the same folder the same name, so a rename that would cause a clash is refused rather than overwriting anything. It also cannot rename files you do not have permission to change or files marked Locked in Get Info.

Avoid colons in names. Finder does not allow them, and a slash typed in Finder becomes a colon to the system underneath, which confuses some apps.

Renaming photos by the date they were taken

Finder cannot read the date a photo was taken from inside the file, so it cannot name photos by it. Two built-in tools can.

Photos. Select the photos, choose File, Export, and in the export options set File Name to Sequential with a prefix such as Lisbon. Photos numbers them in the order they appear in the library or album, which for most albums is the order they were taken.

Shortcuts. The Shortcuts app has actions to get the details of a file, including its creation date, and to rename a file. A shortcut that combines them can be set to run as a Quick Action from Finder’s right-click menu, so you select photos and choose it. It takes a few minutes to build, and it is worth it if you do this every month.

The Terminal route for patterns Finder cannot handle

Some renames need a pattern: moving a date from the end of a name to the start, or changing one extension to another across hundreds of files. The zsh shell every recent Mac uses has a renaming command built in, called zmv. Load it first:

autoload zmv

Then do a dry run with -n, which prints what would happen and changes nothing:

zmv -n 'IMG_(*).jpeg' 'Lisbon-$1.jpg'

The part in parentheses is captured and reused as $1, so IMG_4021.jpeg would become Lisbon-4021.jpg. When the list looks right, run the same command without -n. Keep the single quotes; they stop the shell expanding the stars before zmv sees them. There is no Command-Z here, so the dry run is the safety net. Run it inside a copy of the folder the first time.

Names that still make sense next year

Batch renaming is the moment to choose a pattern you will stick to. Dates written year first, as 2026-10-06, sort correctly in any window. A short project or place word followed by a number stays readable when the file is attached to an email. Naming and folder habits that keep a Mac searchable goes further.

Finder’s defaults work against this a little: extensions hidden, folders mixed in with files. If you set up Macs often or like to experiment, Mainspring shows Finder settings such as all file extensions, folders on top and the full path in the title bar as one-click power-ups, and snapshots each one first so it flips back in a click. It is $29 once for up to three Macs, with a free one-day trial. For one Mac and one afternoon, the Finder settings above are all you need.

Questions

Can I rename folders as well as files? Yes. The renamer works on any selection, folders included, and you can mix files and folders in one batch.

Will renaming break anything? It can, where another app finds a file by its name: a layout document with linked images, a project file, a playlist. Finder aliases follow a renamed file, but those references may not. Never rename files inside an app or inside the Photos library package.

Is there a limit to how many files I can rename at once? Not one you are likely to meet in normal use. With thousands of files, the rename takes longer, and checking the example before clicking matters more.