1

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?

3 Answers3

1

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
Lri
  • 42,502
  • 8
  • 126
  • 159
1

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

studgeek
  • 2,455
0

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