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)
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)
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:
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}'
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))}'
thank you for your reply. i am on el capitan 10.11.6, so this did not work for me.
i tried your sugestions but this is what it said:
Print: Entry, ":SGTRecentFileSearches", Does Not Exist
The domain/default pair of (com.apple.Finder, SGTRecentFileSearches) does not exist
how can i see my recent Finder searches?