Ledge

How to rename a batch of files on a Mac before you send them

Finder can rename many files in one go. Select them, Control-click, choose Rename, and pick Replace Text, Add Text or Format from the menu at the top of the dialog. That covers most tidy-ups before you send files to someone, and if the result is wrong, Command-Z puts every name back.

Opening Finder’s rename tool

  1. Select the files in a Finder window. Command-A selects everything in the folder, Shift-click selects a run, and Command-click adds or removes single files.
  2. Control-click any of the selected files and choose Rename. On older versions of macOS the item reads Rename followed by the number of items. You can also choose File > Rename from the menu bar.
  3. In the dialog, use the menu at the top left to pick one of three modes: Replace Text, Add Text or Format.
  4. Fill in the fields and click Rename.

The file extensions are left alone in the Add Text and Format modes, so a .jpg stays a .jpg and a .pdf stays a .pdf.

Replace text in every name

Replace Text finds a piece of text in each name and swaps it for something else. It is the right tool for fixing names that share a pattern.

  • Camera names. Replace IMG_ with Lisbon- and IMG_2041.jpg becomes Lisbon-2041.jpg.
  • Version labels. Replace final with v2 across a set of drafts.
  • Spaces. Type a single space in Find and a hyphen in Replace with. Names like Site plan rev B.pdf become Site-plan-rev-B.pdf, which is friendlier to web upload forms and command lines.
  • Removing text. Leave Replace with empty and the found text simply disappears from every name.

Only names that contain the text change. Anything else in the selection is left as it was.

Add a prefix or a suffix

Add Text puts the same text before or after every name. Type the text, then choose before name or after name from the menu beside it.

A date prefix is the classic use. Add 2026-09-30 followed by a space, before name, and the files sort together by date wherever they end up. After name is handy for labels such as -draft or -signed. Text added after the name goes before the extension, so report.pdf becomes report-signed.pdf rather than report.pdf-signed.

Number a set in order

Format replaces the names entirely with a base name and a number. This is what you want for a set of photos or scans that should arrive as a clean sequence.

  1. Choose Format from the mode menu.
  2. Set Name Format to Name and Index for plain numbers, or Name and Counter for numbers padded with leading zeros, which sort correctly past nine.
  3. Set Where to after name or before name.
  4. Type the base name in Custom Format. Include a trailing space or hyphen if you want one between the name and the number.
  5. Set Start numbers at, usually 1, and click Rename.

Finder numbers the files in the order they are sorted in the window. Before you start, sort the folder the way the numbers should run, by name or by date, and glance at the first and last files afterward to check.

Undoing a rename that went wrong

Press Command-Z straight away, or choose Edit > Undo Rename. Every file in the batch goes back to its old name at once. Do it before you move on to other file operations, because Undo steps back through your most recent actions in order.

If a file refuses to rename, check whether it is locked. Select it, press Command-I, and look for the Locked checkbox in the Info window. Uncheck it, close the window, and rename again.

Terminal for what Finder cannot do

Some jobs are easier in Terminal, such as changing the extension on a whole folder of files while making sure nothing already there gets overwritten. A short loop does it. This example changes every .jpeg in a folder to .jpg:

cd ~/Desktop/Upload
for f in *.jpeg; do mv -n "$f" "${f%.jpeg}.jpg"; done

The -n option tells mv never to overwrite a file that already exists, so a name clash is skipped rather than lost. Try any loop like this on a copy of the folder first. Instead of typing the folder path after cd, you can type cd with a space and drag the folder into the Terminal window; paths with spaces in the terminal, and how to avoid trouble explains the backslashes you will see.

Gather, rename, then send

The rename tool works on one selection, and the files you want to send often start in different places: two scans in Downloads, a photo on the desktop, a signed form in a project folder. Bringing them together is the slow part.

Ledge takes care of that. As you come across each file, drag it up to the notch and let go; it lands on a shelf that drops from the notch and stays there. When the set is complete, make a folder, open the shelf with Option-Space or a click on the notch, and drag everything onto the folder. The files themselves move into it. If the originals must stay where they are, duplicate each one first with Command-D and shelf the copies.

Now rename the whole set in one pass. Then send it on. If the chat window or upload page is buried under other windows, select the renamed files, drag them back up to the notch, bring the destination forward, and drag them off the shelf into it. A chat app receives the files as uploads; a terminal receives their paths. Ledge has no account and no cloud, so nothing leaves the Mac until you send it. If the recipient would rather have one download, how to zip files from different folders into one archive takes it from there, and batching files for a single upload on a Mac covers upload forms.

Questions

Can I rename files from different folders at once?

In a Finder search results window you can often select files that live in several folders and rename them together; each file stays in its own folder. Otherwise, gather them into one folder first.

Does renaming change anything inside the file?

No. Only the name changes. The contents are untouched, and apps that open the file will not notice a difference.

Why did Format give my files the wrong order?

Finder numbered them in the order the window was sorted. Undo with Command-Z, sort the window the way you want, and rename again.