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.

I'm used to using the search window in Windows that provided the ability to use options such as:

  • Date of Creation/Modification
  • File Size
  • File Extension
  • Wild Card Characters

How can I search with Spotlight with similar criteria?

share|improve this question

3 Answers 3

up vote 6 down vote accepted

This article has a lot of good information on maximising the power of Spotlight search. To search by date, for example:

Check the Date Looking for a file that was created during a specific time period? Spotlight has a handle on dates. Typing date:today will bring up files you created, read, received, or opened today. You can also use the date: keyword with yesterday and tomorrow (for the latter, Spotlight restricts its results to iCal events and to-do items).

The latest version of Spotlight also lets you specify more parameters (whether a file was created or modified on a certain date), as well as enter an exact date or a range of dates. For example, you can type created:12/25/07 to find files authored on that date; type modified:<11/30/06 to look for files changed before that date; or type created:1/1/06-12/31/06 to locate files created between these two dates. Unfortunately, date: keywords don’t seem to work correctly all the time.

share|improve this answer
    
Adding to all that, you can also use Command + Option + Space to open the "Searching" window (or select "Show All" on the regular search area) in which you can press the + button to add filters. –  Cawas Apr 23 '10 at 20:34

Unfortunately it seems you can only do wildcard queries using "raw queries" which are typically associated with the mdfind command. For example (the c at the end makes it case-independent):

mdfind "kMDItemDisplayName=='*back*'c"

While you can't do Raw Queries from the simple Spotlight fields (menubar and upper right in Finder), you can use Raw Queries from Finder advanced search (aka Spotlight window). Jump to finder search in Finder using Command-F (or use the global shortcut Command-Option-Space). Then change the Kind to "Others > Raw Query":
Raw Query example

You can then click Save to add it as a Smart Folder in the Sidebar. To skip the Others and get to Raw Queries a little faster you can add Raw Query to the Kind drop-down menu: Adding Raw Query to menu

A little more info on mdfind and wildcards is at http://macdevcenter.com/pub/a/mac/2006/01/04/mdfind.html?page=3. Also see this great superuser blog post by @slhck at Digging Deeper: Mastering Spotlight in OS X. The different attribute keys you can use is at Apple MDItemRef.

share|improve this answer
1  
More info on mdfind in our blog: Digging Deeper: Mastering Spotlight in OS X –  slhck Oct 22 '12 at 13:53

The Finder provides you with multiple options to constrain the search: (in 10.4) just select File>>Find... from the Finder's menu and click on the (+) button to get more options like the size, the kind of the file, or when it was last opened.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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