Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question

marked as duplicate by Am1rr3zA, sentinel, Chealion Oct 20 '10 at 0:11

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.

    
WHen you say “end” you mean extension as in: “xxxx.jar” or “myjar.mp3”? –  Martín Marconcini Oct 18 '10 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 Oct 22 '12 at 13:57

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

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