how can i see my recent Finder searches?

does anyone know if there is there a way to view my recent searches which i made in Finder?


any help appreciated - thank you.

iMac (Retina 5K, 27-inch, Late 2015), OS X El Capitan (10.11.6)

Posted on Oct 18, 2018 6:44 AM

Reply
3 replies

Oct 22, 2018 7:25 AM in response to Abstractman23

In El Capitan, Apple did not store the SGTRecentFileSearches dictionary items in the FInder preferences file. Instead, it is in the GlobalPreferences file.


When I enter the following string in a Finder search entry:


name:.py


It is stored in the SGTRecentFileSearches dictionary as:

User uploaded file

where name: is shorthand for kMDItemDisplayName. The previous command-line was just capturing the values attribute of the dictionary, so you would see .py, but not name:.py which was the original context. Trying to reassemble the full search string context would require an application, and not a command-line solution.


The following will work under El Capitan, but not on more recent releases of macOS.


defaults read -g SGTRecentFileSearches | awk '/values =/ {getline;$1=$1;print}'

Oct 18, 2018 10:29 AM in response to Abstractman23

Dock : Launchpad : Other : Terminal.app. Copy and paste the following scrollable entry to the Terminal, followed by a return. It will list recent searches that you entered in the Finder search entry area. Tested on High Sierra 10.13.6, and Mojave 10.14.


/usr/libexec/PlistBuddy -c "print :SGTRecentFileSearches" com.apple.Finder.plist | awk '/name =/ {print substr($0, index($0, $3))}'


This will also work:

defaults read com.apple.Finder SGTRecentFileSearches | awk '/name =/ {print substr($0, index($0, $3))}'

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how can i see my recent Finder searches?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.