Renaming a file on a Mac doesn't have a big obvious button, which is why so many people search for it. It's quick once you know the key: on a Mac, Return renames, it doesn't open. Here's how to rename one file, a whole batch, file extensions and folders, and what to do when Finder refuses.
Rename one file or folder
This works in Finder and on the Desktop, for files and folders alike.
- Click the file once to select it.
- Press Return. The name turns into an editable box with everything except the extension selected.
- Type the new name.
- Press Return to save it, or Esc to cancel.
Prefer the mouse? There are three other ways to get the same editable box:
- Right-click the file and choose Rename.
- Select the file and choose File › Rename from the menu bar.
- Click the file to select it, wait a second, then click its name once more.
Opening a file is ⌘O or a double-click, so Return is free for renaming. Coming from Windows, where F2 renames and Enter opens, this is the one habit to swap.
Rename many files at once
Finder has a batch rename tool built in. It can replace part of every name, add text to every name, or give the whole set a fresh name with a number.
- In Finder, select the files. Click the first, then ⇧-click the last, or hold ⌘ to pick them one by one.
- Right-click any of them and choose Rename (it says Rename 12 Items… or similar).
- Choose what to do from the first menu:
- Replace Text swaps one bit of text for another in every name, like
IMG_→Paris_. - Add Text puts the same words before or after every name.
- Format gives every file a new name plus a counter, index or date, like
Invoice 1,Invoice 2.
- Replace Text swaps one bit of text for another in every name, like
- Check the Example at the bottom, then click Rename.
Finder's batch rename can only use one pattern for the whole set. If every file needs its own name, like a folder of screenshots that are all different, see how to rename many screenshots at once for the options.
Change a file extension
By default, Finder hides extensions like .png or .pdf for many files. To see and change them:
- In Finder, choose Finder › Settings › Advanced.
- Tick Show all filename extensions.
- Rename the file as usual and edit the part after the dot.
- When Finder asks, click Use .xxx to confirm.
Undo a rename
Renamed the wrong file? Press ⌘Z in Finder straight away, or choose Edit › Undo Rename. This also undoes a batch rename in one step.
Rename a file from an app
In many Mac apps, like Pages, Preview, TextEdit and Keynote, you can rename the open document without going to Finder. Click the file name in the title bar at the top of the window, type a new name and press Return. The file is renamed wherever it's saved.
Rename with Terminal
If you're comfortable with the command line, the mv command renames a file:
mv "old name.png" "new name.png"
Put names with spaces in quotes. Run it from the folder that has the file, or use full paths. Be careful: if a file with the new name already exists, mv replaces it without asking.
Automate renaming
For renames you repeat often, the Shortcuts app has a Rename File action, and you can add a shortcut to Finder's Quick Actions menu. Automator, the older automation app, has a Rename Finder Items action that works the same way.
When a file won't rename
- It's locked. Select it, press ⌘I and untick Locked.
- It's open in another app. Close the document or quit the app, then try again.
- You don't have permission. Files in system folders or another user's folders may be read-only. Press ⌘I and check Sharing & Permissions at the bottom.
- The name has a colon. Finder doesn't allow
:in file names. Use a dash instead. - Two files would have the same name. A folder can't hold two files with the same name and extension, so add something to make it unique.
Make files easier to find later
Good names do most of the work in search. Spotlight and Finder both search file names, so “Q3 Invoice Acme” is found in a second while “Scan 14.pdf” isn't. For screenshots in particular, see how to find an old screenshot fast, and to stop them landing on your Desktop, change where screenshots save.