Can I use Spotlight to search for files by name?

Solution 1:

You can use this in your search to search for files with 'query' in their name: name:query

For more info about Spotlight commands, you can take a look at an excerpt of Mac OS X: The Missing Manual.

Solution 2:

Spotlight needs you to search using the name: selector to restrict the results.

name:index.html in spotlight

I've also become a big fan of the Found app. It's currently free on the app store and lightning fast (seems faster than LaunchBar to me - and that's saying a lot as it's a speed demon). It's real claim to fame is that it also indexes DropBox, Gmail, Google Drive and Google Docs.


Back to spotlight if you don't want another app no matter how robust, slim and fast. Since the spotlight window defaults to showing everything - not just limited to searching the file name, I like to open the Finder search window and click on name. For me it's quicker than using the name:img trick since I get more hits than the spotlight window itself will show and end up hitting the show all results more often than not.

option +command +space and then you can type the name you wish to find followed by a click on the File Name button will only show the results with that string in the file name.

Search Window