Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com 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.

add comment

3 Answers 3

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 http://superuser.com/a/491119/66255

share|improve this answer
add comment

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
add comment

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. –  0x7fffffff May 16 '12 at 2:49
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.