Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How to use wildcard characters in Spotlight search?

I have two questions about Spotlight:

  1. Can Spotlight be set to not search keywords in files' contents? I just want to search the file names.

  2. Can I search for wildcards, such as "*.exe" or "*d.exe" to find all the files which are ended with exe?

share|improve this question

migrated from May 16 '12 at 2:27

This question came from our site for professional and enthusiast programmers.

marked as duplicate by slhck Oct 22 '12 at 13:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

The normal Spotlight UI doesn't support wildcards, but you can (almost) search by extension.

Open a Spotlight window with ⌥⌘␣ and select Filename contains (or press ⌃⌘F in Finder):

Or in the Spotlight menu:

mdfind does support wildcards:

mdfind "kMDItemFSName=='*.exe'c" # ignore case
share|improve this answer
For those looking for a command line, pseudo locate, add something like this to your bash initialization: function mdname () { mdfind "kMDItemDisplayName==$@" } – jwd630 Jan 14 '15 at 22:24

As far as I know this cannot be done, the only preferences for Spotlight are to change what folders to ignore, and what kind of files to search for (more broadly, images, music etc...)

EDIT: This can be achieved using Automator as demonstrated in the screenshot below.

enter image description here

share|improve this answer
is there any tool can achieve my purpose? – showtimefan May 16 '12 at 2:42
@showtimefan See edit above. – Mick MacCallum May 16 '12 at 2:49

You can do wildcard searches using "Raw Queries" in the Finder advanced find view (aka Spotlight window). For example:
Raw Query example

More info at

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .