Change Number of Files in Recent Menu on Mac OS X
In this article
To change the number of files shown in the Recent Items menu on macOS, you use the Terminal to modify a system default, as there is no graphical setting for this. The default is 10 recent items, but you can set it to any number from 1 to 50, or disable the list entirely.
Why the Recent Menu Shows a Fixed Number
macOS’s Recent Items menu (Apple menu > Recent Items) tracks the last files you opened in supported apps, and it also appears in the Dock icon of many apps. Apple hard-codes the default limit at 10 items, and unlike some other operating systems, it does not expose a slider or dropdown in System Settings to change this. The setting is stored in a hidden preferences file, which is why most users never find it. The same mechanism controls the number of recent servers, and recent documents in some apps, though many apps (like TextEdit or Pages) have their own independent recent-file lists.
How the Setting Works Under the Hood
The relevant preference is NSRecentDocumentsLimit, a key in the global domain com.apple.recentitems. When you open a file in a Finder-supported app, macOS records it in a plist file at ~/Library/Preferences/com.apple.recentitems.plist. The system reads the limit value each time it builds the menu. If you set the value to 0, the Recent Items submenu disappears entirely. If you set it to, say, 25, the menu will show up to 25 entries, and older entries are pushed off as new ones are added. The change takes effect immediately for the Apple menu, but some apps may need a restart to reflect the new limit.
How to Change the Limit Using Terminal
The only reliable method is to write a new value to the preference using the defaults command. Here are the exact steps for any recent macOS version (including Ventura, Sonoma, and Sequoia):
- Open the Terminal app (found in /Applications/Utilities/).
- Type the following command and press Return:
defaults write com.apple.recentitems NSRecentDocumentsLimit -int 15
Replace15with any number from 1 to 50. To disable the list, use0. - Log out and back in, or restart your Mac, for the change to fully apply to all apps.
If you want to revert to the default of 10, run the same command with -int 10, or delete the key entirely with defaults delete com.apple.recentitems NSRecentDocumentsLimit.
What to Do If the Change Doesn’t Take Effect
Sometimes the menu still shows the old number after the command. The most common cause is that the Finder or the app you are checking caches the menu. A simple fix is to force-quit the Finder (right-click the Finder icon in the Dock and choose Relaunch). For third-party apps, quit and reopen the app. If it still doesn’t change, make sure you typed the key exactly as shown, including the capital letters. Also, check that you are not using a sandboxed app that maintains its own recent list – for example, Microsoft Word has a separate setting under Preferences > General. The Terminal method only affects the system-wide Recent Items menu, not every app’s internal recent list.
Comparing macOS to Windows and Linux
Windows 10 and 11 let you change the number of recent files in File Explorer via Folder Options (the “Number of recently used files” spinner, up to 99). Linux desktop environments like GNOME and KDE also expose a similar setting in their file manager preferences. macOS is the outlier, hiding this option behind a command-line tool. That said, macOS’s approach is consistent with its philosophy of keeping the user interface simple – most users never need to adjust this, so Apple doesn’t clutter the Settings app. For power users, the Terminal is the intended escape hatch.
Clearing the Recent Menu Entirely
If you want to remove all current entries without changing the limit, you can do that from the menu itself: Apple menu > Recent Items > Clear Menu. This clears the list instantly, but new files you open will reappear. To prevent any files from appearing, set the limit to 0 as described above. Note that clearing the menu does not delete the files themselves – it only removes the shortcuts. This is a useful privacy measure if you share your Mac, but be aware that some apps (like Preview) may still show their own recent files in their File menu.
Frequently Asked Questions
Can I change the recent files limit without using Terminal?
No, there is no graphical user interface for this setting in any version of macOS. You must use the Terminal or a third-party utility like TinkerTool or OnyX, which essentially run the same defaults command for you. If you are uncomfortable with Terminal, those tools provide a checkbox interface, but they are not pre-installed.
Why does my Recent Items menu show fewer than 10 items even though I never changed it?
That happens when you have not opened enough files to fill the list, or when the system has removed entries that no longer exist. macOS automatically drops entries for files that have been deleted or moved to an external drive that is not connected. The limit is a maximum, not a minimum.
Will changing the limit affect the recent items in the Dock?
Yes, the Dock’s right-click recent items for apps like Pages or Xcode use the same system-wide limit. However, some apps override this with their own settings. For example, Safari’s “Show Recent” in the History menu has a separate preference. The change applies to the generic Apple menu and most apps that rely on the system’s recent documents service.
What is the maximum number I can set?
Apple does not document an official maximum, but values above 50 are unreliable. The system may ignore numbers higher than 50 or cause the menu to become sluggish. Stick to 1–50 for predictable behavior. Setting 0 disables the menu entirely.
Does this work on macOS Sonoma and Sequoia?
Yes, the com.apple.recentitems preference has remained unchanged since OS X Lion. The same command works on all modern versions, including Sonoma (14) and Sequoia (15). Apple has not moved this setting to the new System Settings interface.