Search Spotlight From The OS X Terminal

Search Spotlight From The OS X Terminal

Mac: While you can access the Mac’s Spotlight search feature easily with the Command+Space shortcut, you might want a little more control over the results you get. Utilising the mdfind command in the OS X Terminal can make that happen quickly.

Take this for example:

mdfind -name homebrew

That command will tell mdfind — the process that handles Spotlight searches — to search by name and find any file name containing the word homebrew. It can do a whole lot more, too. If you want to learn the different kind of searches you can perform in the terminal with mdfind, check out its man page.

5 Unix Commands I Wish I’d Discovered Years Earlier [Atomic Spin]