Spotlight is a built-in search engine on macOS.
1. How to open and use Spotlight on Mac
To access Spotlight, click on the magnifying glass button in the menu bar top-right or hit Command+Space on your keyboard.
Type your search terms and Spotlight will bring up the relevant results.
Narrowing down your search results could be essential when you work with a large number of files. Spotlight allows you to type complex search queries by using search operators, which define various types of file properties (type, date created, title, etc.)
2. Search by file category - text, picture, movie, music or application
You can use Spotlight to look for a specific file category (picture, movie, text, music) using the keyword "kind" followed by a colon and the desired file type. Let us look at some examples:
kind:app – displays only applications.
You can type your search term and then specify the type of files in which to search for it:
utility kind:app – displays all applications that have the word "utility" in their title or description.
Similarly, you can narrow down your results to contacts, folder names, emails, videos, images, or presentations by using their respective keywords:
projects kind:folder – displays all folders containing the word "project" in the file name.
brave kind:movie – displays all videos that have the word "brave" in the file name.
3. Search by file extension
You can also use the "kind" operator to look for files with a specific extension (.csv, .docx, .pdf, etc.). Note that Spotlight might want you to use the full extension name for some of them (for example, "OpenDocument" instead of "odt"). Examples:
kind:docx – displays all files with .docx extension.
kind: OpenDocument – displays all files with .odt extension.
spinner kind:gif – displays all gif files containing the word "spinner" in the file name.
4. Search by date
There are several other useful operators provided by Spotlight that might come in handy:
modified:date – displays all files modified on the given date.
created:date – displays all files created on the given date.
Both operators require a date parameter that by default has to be written in the format "month/day/year." If you use a different date format and want to change it, go to System Preferences -> Language & Region -> Advanced -> Dates.
You can modify or create your custom date formats. For example:
essay created:7/17/2022 – show files created on 17th of June 2022 that contain the word "essay."
If you don’t want to specify a day or month, you can just type a year:
project modified:2021 – displays files containing the word "project" that were modified in 2021.
Additionally, you can search for files created or modified before or after a given date by putting the <, =, or > symbols (or combinations of them) before the date.
created:<7/17/2020 – displays files created before this date.
created:>=7/17/2020 – displays files created on or after this date.
sunset kind:image created:>07/15/2021 – displays images created after the 15th of July that contain the word "sunset."
5. Search by author or publisher name
To search by author or publisher with Spotlight, use:
Both operators will display files created by the given author.
You can combine search operators to narrow down your results even further:
kind:pdf by:Adam – displays all .pdf files written by Adam.
kind:music by:Brahms – displays music files created by Brahms.
6. Other search operators
Spotlight supports many other search operators that might be relevant in different scenarios. To find them:
- Right-click on any file.
- Click on "Get Info."
- In the General and More Info tabs, you will see the properties you can use in your search queries.
Note that different file types might have their own specific properties (i.e. "duration" for music files).
7. Combine search conditions
Boolean operators are used to combine two or more search conditions. They can also be used together with any other operators or search words.
1. OR – used between two and more operators or keywords. Spotlight will return results that satisfy either of the conditions. If you don’t use OR between different operators, you will get only the results that match all the conditions.
Here are some examples of using the OR operator:
sun kind:image OR kind:video – returns pictures or videos that contain the word "sun."
title:certificate OR title:contract OR title:report – gets all files that contain any of these keywords in their tiles.
2. NOT – used before a keyword or operator to exclude results that match the condition.
loading kind:image NOT kind:gif – displays images that contain the word "loading" except .gif files.
modified>2012 modified:<2020 NOT modified:2015 – displays files modified between 2012 and 2020, but excludes those modified in 2015.
There is also a short version of the "NOT" operator - the dash character. It should be joined with the keyword or condition without space.
brain -research kind:pdf – returns .pdf files that contain the word "brain" but not "research."
network -kind:image – returns non-image files that contain the word "network."