Clear Recents folder in Finder on MacBook

MAC OS - Terminal command to clear RecentDocuments?

defaults delete com.apple.Preview RecentDocuments
Domain (com.apple.Preview) not found.
Defaults have not been changed.

defaults delete com.apple.finder RecentDocuments
Domain (com.apple.finder) not found.
Defaults have not been changed.

I need to be able to clear the Recent Documents on my Macbook which currently shows the last 1500+ items I've opened.
The APPLE Logo, Recent Items, Clear Menu doesn't clear the items in Recents when I open Finder.

Anyone got a quick and easy way to do it via Terminal?

By the way, to clear all the up arrow / down arrow history in terminal type history -c and press ENTER.
Erika KoelleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

serialbandCommented:
Which version of OS X do you have?   They're may be a bit different from system to system.

Just turn it off.
Go to System Preferences -->General --> On Recent Items, Select None
or
defaults write -g NSNavRecentPlacesLimit -int 0


Then delete the entries - if you have the same version I have.
defaults delete NSGlobalDomain NSNavRecentPlaces

Then delete all the other recent lists for each individual app.  This is an easier line than going through defaults and finding each apps defaults file and clearing it.
rm -f ~/Library/Preferences/*LSSharedFileList

Then restart Finder
killall Finder

You must restart the Finder for it to reload the recent files lists.  Otherwise, Finder will continue to show the previous files loaded.  If you didn't also turn off the items, when you quit, it will still write the previous items back along with the newest recent items.
0
Erika KoelleAuthor Commented:
I'm trying to flush out all the items in Finder (Favorites / Recents).  I have over a thousand JPG files in there that I want to not see in my recents.  I'm running macOS High Sierra 10.13.3
0
serialbandCommented:
rm -f ~/Library/Preferences/*LSSharedFileList

If you mainly opened with Apple's Preview App, you can specifically remove com.apple.Preview.LSSharedFileList.plist and com.apple.Preview.SandboxedPersistentURLs.LSSharedFileList.plist

You may have to log out then log back in.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Erika KoelleAuthor Commented:
I've attempted the command below but it doesn't do anything to remove items in my Recents folder:
rm -f ~/Library/Preferences/*LSSharedFileList

I logged off and back on and that didn't change anything.

remove com.apple.Preview.LSSharedFileList.plist
-bash: remove: command not found

Any other tips?
0
serialbandCommented:
The command is rm, not remove.
0
Erika KoelleAuthor Commented:
rm com.apple.Preview.LSSharedFileList.plist

ERROR Received Back:
rm: com.apple.Preview.LSSharedFileList.plist: No such file or directory
0
serialbandCommented:
That means it that you're not in the correct directory.

I gave you the full command previously.
rm -f ~/Library/Preferences/*LSSharedFileList

If that didn't work then something's missing in the command.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.