8

Possible Duplicate:
How Can I Search A Specific Type of File in Mac?

How could I use spotlight to search for example for files that end with jar or files that end with doc and at the same time contains "Hello" in it's name?

2
  • WHen you say “end” you mean extension as in: “xxxx.jar” or “myjar.mp3”? Commented Oct 18, 2010 at 10:50
  • This question isn't a duplicate, its asking how to search with a wildcard while the linked question is asking how to search by type. For how to search using a wildcard see superuser.com/a/491119/66255.
    – studgeek
    Commented Oct 22, 2012 at 13:57

1 Answer 1

10

I’m assuming by “end with” you mean that files have the extension .jar or .doc. And given all those filenames, you want those who have “hello” in their filnames.

With that in mind, you’re looking for something like this:

(.jar AND “hello") OR (.doc AND “hello”)

Additionally, you could extend the number of “words” by adding:

(.jar AND “hello” OR “some_other_word") OR (.doc AND “hello”)

For more ninja commands for Spotlight, your best bet is to read throughout this interesting doc from Apple, that’s the Spotlight’s Query Language documentation with lots of examples.

Finally, if you want to know what attributes are available for you to query directly, refer to this blog post.

2
  • I have a problem with the Yosemite Finder search. I have the Oxygen icon theme downloaded in png format. If I search for wallet, I get only wallet- file names. Only if I search for kwallet would I get kwallet- file names. Is the search only a starts-with search? With other searches it didn't seem that way. Commented Feb 23, 2015 at 14:41
  • How can I add things like \s or \d to the group ? or is it limited to logical operands only? figured it out: in preview you can do this: ("\s" AND "an" AND "\s") ;-) for pdf regex
    – PJJ
    Commented Dec 23, 2016 at 17:18

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