Rename Shortcut Key: How to Rename Files Fast
In this article
The rename shortcut key depends on your operating system and the app you are in. On Windows, the universal shortcut to rename a selected file or folder is F2. On macOS, it is Return (the Enter key). In most file managers on Linux, F2 also works. These shortcuts let you rename an item without right-clicking and choosing a menu option, which saves time when organizing files. Before you start, make sure the file or folder is selected and that you have permission to modify it. If the item is on a read-only drive or in a system folder, the rename option may be greyed out or the shortcut may do nothing.
What You'll Need
- A computer with Windows, macOS, or a Linux desktop environment.
- The file or folder you want to rename must be visible in a file manager (File Explorer, Finder, or your Linux file manager).
- You must have write permission for the location. If you are not the owner or the folder is protected, you may need administrator rights.
- For some apps (like photo editors or code editors), the rename shortcut may differ; check the app's own menus.
Step-by-Step
- Select the item. Click once on the file or folder you want to rename. In Windows File Explorer, you can also use the arrow keys to highlight it. Make sure only one item is selected; if multiple items are selected, the rename shortcut will rename only the first one or may not work as expected.
- Press the rename shortcut. On Windows, press F2. On macOS, press Return. On most Linux file managers (GNOME Files, KDE Dolphin, etc.), press F2. The filename will become editable, often with the name highlighted (or just the part before the extension selected).
- Type the new name. The old name is usually selected so you can type over it. If only part of the name is selected, use the arrow keys or mouse to position the cursor. Be careful not to change the file extension (the part after the dot) unless you intend to; changing it can make the file unopenable by the default program.
- Confirm the rename. Press Enter (Windows) or Return (macOS) to apply the new name. On macOS, after pressing Return to enter edit mode, press Return again to confirm. On Windows, pressing Enter confirms. If you change your mind, press Esc to cancel.
- Check for errors. If the name is already taken or contains invalid characters, you will see an error message. Windows disallows characters like \ / : * ? " < > |. macOS disallows : and / (though Finder may substitute). Adjust the name and try again.
Note: Menu labels and exact key behavior can differ slightly between versions of Windows, macOS, and Linux distributions. The steps above are for the desktop file managers; mobile devices and some apps use different methods (see Tips).
Common Mistakes
- Renaming the extension by accident. When you press F2 in Windows, only the base name (before the dot) is selected by default. If you type a new name and the extension gets overwritten, the file may not open. To avoid this, press the Right arrow key after pressing F2 to deselect the extension, or enable "File name extensions" in File Explorer's View tab to see what you are editing.
- Using the wrong key on Mac. Many people press F2 on a Mac, but that often triggers a different function (like brightness or Mission Control). Use Return instead. If you have a third-party file manager, check its shortcuts.
- Renaming a file that is open in another program. If the file is in use, Windows may block the rename or allow it but cause issues. Close the program first.
- Renaming system files or folders. Do not rename files in Windows, Program Files, or macOS System folders unless you know what you are doing; it can break the OS or apps.
- Expecting the shortcut to work in every app. In web browsers, PDF readers, or text editors, F2 may do something else. Use the app's own rename function (often in a right-click menu or File menu).
Tips
- Batch rename: Windows File Explorer does not support renaming multiple files with F2 at once, but you can select multiple files, press F2, type a name, and Windows will append numbers (e.g., "Photo (1).jpg"). macOS Finder does not have a built-in batch rename shortcut; use the right-click > Rename X Items option. Linux file managers often have bulk rename tools.
- Slow rename: If you press F2 and nothing happens, try clicking on the file name text itself (not the icon) once, then press F2 again. Sometimes the focus is not on the file list.
- Mobile devices: On iPhone and Android, there is no physical keyboard shortcut for renaming files in the Files app or other file managers. Tap and hold the file, then choose Rename from the context menu.
- In Microsoft Office: F2 in Excel edits the active cell; in Word, it may move text. To rename a file in Office apps, use File > Save As or File > Rename (if available).
- Keyboard alternatives: On Windows, you can also right-click and choose Rename, or use the keyboard menu key (often between right Alt and Ctrl) then press M. On macOS, you can right-click and choose Rename.
Troubleshooting
If the rename shortcut does not work, try these steps in order:
- Make sure the file is selected and the file manager window is active. Click on the file once, then press the shortcut again. If the window is not focused, the key may go to another app.
- Check if the file is read-only or in a protected location. Right-click the file, choose Properties (Windows) or Get Info (macOS), and see if the Read-only box is checked. Uncheck it if you have permission. For system folders, you may need administrator approval.
- Try the menu method. Right-click the file and see if Rename is available. If it is greyed out, you likely lack permission or the file is in use. If it works, the issue is with the shortcut key itself (e.g., F2 is mapped to another function).
- Check for keyboard function key settings. On some laptops, F2 requires holding the Fn key. Try pressing Fn+F2. Or your keyboard may have a dedicated rename key (rare).
- Restart the file manager or computer. Sometimes Explorer or Finder gets stuck. Close and reopen the window, or restart the computer.
- Update your operating system. If the shortcut stopped working after an update, check for pending updates. If the problem persists, search for known issues with your OS version.
- If the file is on a network drive or external drive, ensure it is connected and you have write access. Disconnect and reconnect the drive, or check sharing permissions.
If none of these work, the file may be locked by another process. Use Task Manager (Windows) or Activity Monitor (macOS) to close the program that might be using it, then try again.
Frequently Asked Questions
What is the rename shortcut key on Windows?
F2 is the standard shortcut to rename a selected file or folder in File Explorer. It also works on the desktop and in many other file management contexts.
What is the rename shortcut key on Mac?
Press Return (Enter) after selecting a file in Finder. The name becomes editable; press Return again to confirm.
Can I rename multiple files at once with a shortcut?
Not with a single shortcut. On Windows, select multiple files, press F2, type a name, and Windows will add numbers. On macOS, use right-click > Rename Items. Linux file managers vary; check your file manager's bulk rename feature.
Why does F2 not work in some apps?
Many apps use F2 for other functions (e.g., editing a cell in Excel, renaming a layer in Photoshop). In those apps, use the app's own rename command, often found in a right-click menu or the File menu.
How do I rename a file on iPhone or Android?
There is no keyboard shortcut on mobile. In the Files app (iOS) or Files by Google (Android), tap and hold the file, then tap Rename.
What if I accidentally change the file extension?
If you rename a file and change the extension (e.g., from .jpg to .txt), the file may not open correctly. Rename it back to the original extension. To avoid this, enable file name extensions in your file manager's view settings so you can see what you are editing.