Sub topic 10
Finding items with search
This chapter assumes you can open a Finder window, know the difference between the Home folder and other locations, and have used tags. Search is the fast way to find an item when browsing folders takes too long.
Starting a search
Press Command-F in any Finder window to put the cursor in the search field. You can also click the magnifying glass in the toolbar. Type a word and Finder lists matches from the file name and from the file's contents, such as text inside a PDF or document.
Below the toolbar, a scope bar shows where Finder is looking:
- This Mac searches everywhere indexed.
- The folder name (for example "Projects") searches only that folder and the folders inside it.
- Shared appears when you are browsing a network location.
Finder often defaults to This Mac, which returns far more results than you want. Check the scope first.
Narrowing with criteria
As you type, Finder offers suggestions beneath the field, such as "Name matches" or "Kind is PDF Document". Choosing one turns your text into a search token. Tokens narrow the results.
For more control, click the + button under the toolbar after you start searching. Each row is one rule. Common rules include:
| Rule | Example use |
|---|---|
| Kind | Show only images or PDFs |
| Last opened date | Find what you used this week |
| Name | Match "contains", "begins with" or "ends with" |
| Tags | Show items with a given tag |
Several rules combine, so all of them must match. Searching "invoice", Kind is PDF, and Tag is Urgent leaves a short list.
Working with results
Select a result and press Space to preview it with Quick Look. To see where it lives, choose File > Show in Enclosing Folder, or press Command-R. Results can be sorted in List view by clicking a column header. Add the Path column through View > Show View Options if it is missing.
Searching from Terminal
Finder search uses the Spotlight index, and mdfind queries that same index. This command lists files in Documents carrying the tag "Urgent":
mdfind -onlyin ~/Documents "kMDItemUserTags == 'Urgent'"Common problems
- Too many results. The scope is probably This Mac. Click the folder name in the scope bar.
- A file you know exists is missing. The index may not cover its location. Open System Settings > Spotlight, then check the Search Privacy list for excluded folders. Recently added files can take a short time to appear.
- Results look stale. Remove the folder from the privacy list and add it again to trigger re-indexing.
- Hidden files do not appear. Search skips many system and hidden items. Use Go to Folder instead, covered in a later chapter.
Exercise
You search for "budget" and get hundreds of results from all over your Mac. Name two changes that would narrow the list to PDFs in your Projects folder.
Show answer
Click "Projects" in the scope bar instead of This Mac, and add a Kind rule set to PDF Document, either from the suggestions or with the + button.