Hacker News new | ask | show | jobs
by Zirro 5094 days ago
I'll take the opportunity to ask: Is there a way to make Spotlight index files in the Library folders? There are sometimes some obscure preference or cache-files that I need to find.
3 comments

This is 100% off-topic, but since this submission has 100+ upvotes and many might view the comment thread, and you mentioned Library/ folder, I think it's good to point out that you can easily make Library/ folder visible again in Lion.

Just type:

    chflags nohidden ~/Library
in the Terminal.
You can also access hidden directories from Finder with Cmd-Shift-G and manually typing their path.

Personally, I infrequently access my ~/Library and I know it's there and what it contains and I can hop over to it quickly if needed that I prefer it hidden for visual simplicity.

You'll definitely find what you're looking for here. http://www.macosxtips.co.uk/index_files/terminal-commands-fo...

To save you some time, add a folder as follows:

mdimport -f /Library

On recent OS X versions (Lion at the very least), the problem isn't that /Library and ~/Library aren't indexed by default; they are. Trouble is that if I search for a file named, say "com.apple.RemoteDesktop.plist", Finder appears to run a query akin to

    kMDItemDisplayName == "com.apple.RemoteDesktop.plist"
    && kMDItemSupportFileType != MDSystemFile
which returns nothing on my system, rather than simply

    kMDItemDisplayName == "com.apple.RemoteDesktop.plist"    
which returns three results, one each in subdirectories of /System/Library, /Library, and ~/Library.

There's an option in the "full" Spotlight search window that lets you control this for any given search, under "Other..." in the drop-down you get when you click "+" to add criteria. It's called, logically enough, "System files".

Incidentally, the mdfind command line tool doesn't have this behavior by default.

If you want a nice GUI, try Tembo (http://www.houdah.com/tembo). Tembo is a Spotlight front-end. Incidentally it searches all indexed locations, including Library folders.
To my knowledge it does index those files, they are just not shown in the search results. You can ask Spotlight to show the system files, see this guide: http://support.apple.com/kb/HT4355