Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do you really need it on Mac? We've got mdfind


That's just a cli for Spotlight, right? I have found Spotlight to be increasingly unreliable over the years, to the point of being essentially useless now. Most recently, I discovered that absolutely nothing in my iCloud drive can be found with Spotlight, even if the file is on disk and I'm just trying to match its name. For extra fun, I found an Apple support page that suggested the Windows-in-1999-esque procedure of blocking and then unblocking the directory from indexing in the Spotlight preferences. Unsurprisingly, this didn't work.

Testing out mdfind and trying to simply find a file in a specific directory (which only contains five files):

    mdfind -onlyin . name-of-my-file.md
Nothing.

    mdfind -onlyin . -name name-of-my-file.md
Nothing.

    mdfind -onlyin /absolute/path/to/cwd -name name-of-my-file.md
Nothing.

This is pretty reflective of my experience with the Spotlight GUI. Every search turns up something, but the file I want is almost never in the results.


Spotlight progressively getting worse was one of the reasons I switched to Linux.

I think MacOS is great. Many of the features are brilliant. The UI is second to none to this day.

But holy moly, Spotlight has degraded. From searching my files, to searching my files and the internet, to consistently providing me with nothing I am looking for.

When Apple first started selling OSX it's UNIX heritage was a part of the selling point but my vibe is that they only really consider text input a feature for devs. Which thinking of Mac's history is on brand but just leaves you down many a frustrating dead end.


if you do not have the "show all file extensions" enabled, `.md` query in spotlight will not show up anything.

try without extension. (eg: just the name)

I even have scripts to locate other scripts using mdfind, it is pretty robust to be honest...

Eg:

    source $(mdfind -name spacelatte-bashlib.sh)


It also doesn’t work without the extension. It does work on my work laptop, so I expect that something is broken with my index. But this is also part of the problem. The whole thing is opaque, breaks, and offers no clear recourse for how to resolve any issues.


And FindAnyFile (https://apps.tempel.org/FindAnyFile/index.php), disclosure: happy user with no affiliation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: