Recently searched for a file known to be in ~/Library/Preferences/ (while in OS 10.15), and got no results. Same in 10.11. (But worked in 10.6.)
Files within other "system" folders can be located, and results were always set to "include System Files" and "Visible OR Invisible" and standard troubleshooting like forced re-indexing had been done.
If you navigate to the Preferences folder, the files exist and are displayed.
Both Spotlight and 'mdfind' in Terminal did not locate such files.
But 'find' in terminal did in 10.11, as did 'sudo find' in 10.15.
Seems like files in /Library/Preferences are not seen by Spotlight, as well.
com.apple.dock.plist is a randomly selected example file name seen here in both the /Library/Preferences/ and ~/Library/Preferences/ folders, in both 10.11 and 10.15. But Spotlight only reported the copy of it in /System/Library/LaunchAgents/.
Files within other "system" folders can be located, and results were always set to "include System Files" and "Visible OR Invisible" and standard troubleshooting like forced re-indexing had been done.
If you navigate to the Preferences folder, the files exist and are displayed.
Both Spotlight and 'mdfind' in Terminal did not locate such files.
But 'find' in terminal did in 10.11, as did 'sudo find' in 10.15.
Seems like files in /Library/Preferences are not seen by Spotlight, as well.
com.apple.dock.plist is a randomly selected example file name seen here in both the /Library/Preferences/ and ~/Library/Preferences/ folders, in both 10.11 and 10.15. But Spotlight only reported the copy of it in /System/Library/LaunchAgents/.