Sub topic 10
Searching in Finder
Spotlight in the menu bar is built for speed. Finder search is built for control. It uses the same index, but it shows results in a regular window, lets you scope the search to a folder, and lets you stack criteria. This chapter covers how to search in Finder, how to scope and refine a search, and the mistakes that cause confusing results.
This chapter assumes you can open Finder windows, know where your documents and downloads usually live, and have read the earlier chapters on file search, kinds, and operators. The Terminal example at the end is optional.
How Finder search relates to Spotlight
Finder search and the Spotlight window both query the Spotlight index. The index is the database macOS keeps of file names, file contents, and metadata. Because both tools read it, a file that Spotlight cannot find will usually be missing from Finder search too. In that case, the fix is in the index, not in Finder.
The differences are in the interface:
| Feature | Spotlight window | Finder search |
|---|---|---|
| Opened with | Command-Space | Command-F in Finder, or the search field in a Finder window |
| Shows | Apps, files, answers, and more, in one list | Files and folders only, in a window |
| Scope | The whole Mac | This Mac, the current folder, or a recent-search scope you choose |
| Results view | Short list with preview | Icon, list, column, or gallery view with sortable columns |
| Can be saved | No | Yes, as a saved search |
Use Spotlight when you want to open something fast. Use Finder search when you want to look at many results, sort them, act on several at once, or keep the search.
Starting a search
There are three common ways to start.
- Open any Finder window and click the search field in the top right of the toolbar.
- Press Command-F while Finder is the active app. This opens a search in the current window and puts the cursor in the search field.
- Press Option-Command-Space to open a Finder search window directly. Depending on your settings, this shortcut may be assigned to Spotlight, so check System Settings if it does not respond.
Type your words and press Return. Finder shows matches as you type, and Return confirms the search.
Choosing a scope
When you type a query, a row appears under the toolbar with scope choices. The names vary a little between macOS versions, but they follow this pattern:
- This Mac searches everywhere that is indexed.
- The current folder name searches only the folder you were viewing, including its subfolders.
- Recents or a similar option limits results to files you used lately, in versions that offer it.
The scope matters more than most people expect. If you open a search while looking at your Downloads folder, the default scope is often that folder. If you then wonder why a file in Documents is missing, the scope is the likely reason. Look at the highlighted scope button before you assume the file is gone.
Searching by name versus contents
By default, a Finder search matches both file names and file contents. That is useful, but it can bury a file whose name you remember under many documents that merely mention the word.
After you type a query, Finder offers a choice that looks like this:
- Name matches shows files whose names contain the words.
- Contents matches or a general match includes text inside documents.
If your results look noisy, choose the name-only option. You can also type name:invoice to match file names only, using the same name keyword covered in the earlier chapter on narrowing results.
Adding criteria with the plus button
Typing words is only the first layer. For precise control, click the + button at the right of the criteria row. This adds a row with two drop-down menus: an attribute on the left and a condition on the right.
Common attributes include:
- Kind, such as PDF, Image, Folder, or Document.
- Last opened date, Last modified date, and Created date.
- Name, with conditions such as "contains", "begins with", "ends with", or "matches".
- File size and File extension, which you can reveal with the Other... entry.
You can add several rows. Finder combines them with AND, so a file must satisfy every row. For example, these three rows find PDFs that were changed this month and have "tax" in the name:
- Kind is PDF
- Last modified date is within the last 30 days
- Name contains tax
Reaching more attributes
The criteria menu starts with a short list. Choose Other... to open a longer list of metadata attributes, such as author, number of pages, or camera model. Tick In Menu beside any attribute you use often, and it will appear in the main drop-down from then on. This is a direct view of the metadata the index stores for each file.
Using Any and All
When you add more than one row, Finder may show a pair of options, often labeled Any and All or similar. If you hold the Option key while clicking the + button, the plus becomes an ellipsis. This adds a compound group where you can pick any, all, or none of the nested conditions. Use this when you need OR or NOT logic, because plain rows are always AND.
Sorting and viewing results
The search results window behaves like any Finder window, so the view you choose changes what you can learn.
- List view shows columns for date modified, size, and kind. Click a column header to sort.
- Path information appears when you select a result. Choose View > Show Path Bar to see the folder that holds the file at the bottom of the window. This answers the common question "which of these three copies is the one I want?"
- Gallery or column view gives a preview, which helps for images and PDFs.
To reveal a result's folder, select it and press Command-R, or Control-click it and choose Show in Enclosing Folder. This closes the search and takes you to the file's real location.
Acting on results
Because results are ordinary Finder items, everything you can do to files works here:
- Select several and press Space for Quick Look, or open them together.
- Drag results into an email, a chat, or another folder to copy or move them.
- Use Get Info (Command-I) to see the full path and size.
- Add tags or move a batch to the Trash.
Be careful with bulk actions. Check the count and the Kind column first, so you do not delete files the query matched by accident, such as cached copies or items from an app's internal folders.
Common problems
| Symptom | Likely cause | What to do |
|---|---|---|
| A file you know exists is missing | The scope is limited to one folder | Switch the scope to This Mac |
| A file is missing from every search | The folder is excluded or not indexed | Check the Search Privacy settings, then the index status |
| Far too many results | Matches in contents, not just names | Use `name:` or a Name criterion |
| Results look out of date | The index is stale | Wait, then check indexing and rebuild if needed |
| System files never appear | Finder hides some locations by default | Add a File Extension or Kind criterion, or open the folder directly |
If the same file is missing from both Finder and the Spotlight window, the next place to look is the index itself. The troubleshooting chapter covers mdutil and rebuilding.
Finder search from Terminal
Finder search is a front end for the same query system that mdfind exposes. You can run the equivalent of a scoped, kind-limited Finder search like this:
mdfind -onlyin ~/Documents "kMDItemContentType == 'com.adobe.pdf'"The -onlyin option plays the role of the folder scope. The content type test plays the role of the Kind row. If a Finder search and an mdfind query disagree, the difference is usually the scope or a criterion you forgot.
Summary of the workflow
- Start from the folder you want, or from This Mac.
- Type a few words and check the scope button.
- Switch to a name match if the list is noisy.
- Add rows with + for Kind, dates, and size.
- Use Option-click on + when you need OR or NOT.
- Sort in list view, check the path, then act.
Exercise
You search for "budget" from inside your Downloads folder and the spreadsheet you expect, stored in Documents, does not appear. Spotlight in the menu bar finds it. What is the most likely reason, and how do you fix it in the Finder window?
Show answer
The Finder search scope is limited to the current folder (Downloads), so files elsewhere are not searched. Change the scope button under the toolbar from the folder name to This Mac and the Documents file will appear.
Exercise
How would you build a Finder search for PDF files with "tax" in the name that were modified in the last 30 days, and which kind of grouping do you need if you also want to include Word documents?
Show answer
Add three criteria rows with the + button: Kind is PDF, Last modified date is within the last 30 days, and Name contains tax. Rows combine with AND. To also include Word documents, Option-click + to create a compound group and choose "any" for the two Kind conditions (PDF or Word), then keep the date and name rows as separate required rows.