Search for files on a Mac with Spotlight indexing turned off
· 7 min read
With Spotlight indexing turned off, the Spotlight window, Finder’s search box and mdfind all stop finding files, because all three read the same index. You can still search by name: with find in Terminal (thorough but slow), with locate once you switch on its database (fast but blind to your private folders), or with a search app that keeps its own catalog. Searching inside documents is the part that genuinely needs an index, which is why indexing less is usually a better answer than indexing nothing.
Check that indexing is actually off
Open Terminal and run:
mdutil -s /
“Indexing enabled” means Spotlight is on for your startup disk and the problem is something else; Spotlight cannot find a file you know exists and Rebuild the Spotlight index are the places to start. “Indexing disabled” means someone, possibly you a year ago, turned it off with sudo mdutil -i off / or sudo mdutil -a -i off.
mdutil -as reports on every mounted volume at once, which is useful because external drives are often switched off individually. And check System Settings, Spotlight, Search Privacy (Siri & Spotlight, Spotlight Privacy on Ventura and Sonoma): a whole disk added to that list has the same effect as turning its indexing off.
What stops working, and what does not
With the index gone, these return little or nothing for files on that volume:
- The Spotlight window, including finding apps by typing their names.
- Finder’s search field, Smart Folders and the Recents view, which are all Spotlight queries underneath.
mdfindin Terminal.- Search in apps that hand their searching to Spotlight, Mail among them.
Browsing still works, in Finder and in every Open and Save dialog, and so does searching inside apps that read their own files directly. The Applications folder is one keystroke away with Shift-Command-A.
Search by name with find
find walks through folders one by one and checks every name. It needs no index and misses nothing it has permission to read.
find ~/Documents -iname '*invoice*' 2>/dev/null
That lists every file and folder under Documents with “invoice” anywhere in the name, ignoring case. The quotes around the pattern matter; without them the shell tries to expand the asterisks itself. A few additions cover most searches:
-type dfor folders only,-type ffor files only.-mtime -7for things modified in the last seven days.-size +500Mfor anything over 500 MB.
For example, find ~ -type f -iname '*.pdf' -mtime -7 finds every PDF in your home folder changed this week.
Start as close to the file as you can: find ~/Documents takes seconds, find / can take many minutes. The 2>/dev/null hides “Permission denied” messages, which keeps the output readable but also hides which folders were skipped.
The first time Terminal reaches into Desktop, Documents or Downloads, macOS asks whether to allow it. Folders such as Mail’s data and Messages need Full Disk Access for Terminal before find can see inside them. Full Disk Access on a Mac explains what that grant covers.
To act on a result, open -R followed by the path reveals it in a Finder window, and open followed by the path opens it in its usual app.
Fast name search with locate
macOS ships with locate, a much older tool that searches a prebuilt list of file names instead of walking the disk. The list is switched off by default. To turn it on and build it now:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
sudo /usr/libexec/locate.updatedb
After that, a scheduled job rebuilds the list once a week, early on Saturday morning. Searching is then close to instant:
locate -i invoice
It has two limits:
- It does not see your private folders. The database is built as a special low-privilege user that can only read what is publicly readable. On a Mac, your Desktop, Documents, Downloads and Library folders are private to you by default, so nothing inside them appears.
locateis good for system files, app bundles and shared folders; for your own work, it will mostly come up empty. - It is only as fresh as the last rebuild. A file you saved this morning is not in a list built last Saturday.
To switch it off again, run the first command with unload in place of load.
A search app with its own catalog
One Terminal tool is slow and the other cannot see your files. A search app that builds its own catalog closes that gap without bringing Spotlight back.
Everywhere reads every file name on the Mac into one list, then narrows the results as you type. It also finds mail attachments inside the Mail store, originals inside the Photos library, and files on external drives that are not currently plugged in. It asks for Full Disk Access so it can see everything; if you decline, it works on what it can reach and tells you which folders it is missing. Option-Space opens it over any app, path: limits a search to a folder and ext: to a file type, and Command-Return reveals the selected file in Finder. It makes no network connections at all.
The honest limit: it searches names and paths, not the text inside documents, so it does not replace Spotlight’s content search. It is a one-time purchase with a free day to try it.
Searching inside files, and indexing less instead of nothing
For plain text, grep -ril 'quarterly forecast' ~/Documents lists every file under Documents containing the phrase. It works on text files, code, CSV and Markdown, but not on PDFs, Word or Pages documents, where the words are not stored as plain text. For those, content search needs Spotlight.
People usually turn indexing off for a reason: the indexer was busy for hours, a large external drive kept being scanned, or a private folder kept appearing in results. Each has a narrower fix.
- Busy indexer. Indexing is heavy during the first full pass and light afterwards. If it never settles, the index is probably damaged; rebuild it rather than disabling it.
- External drives. Turn indexing off for just that drive with
sudo mdutil -i off /Volumes/DriveNameand leave the startup disk alone. - Folders you never want in results. Add them to Search Privacy instead. How to exclude a folder from a file search walks through it.
To turn indexing back on for the startup disk, run sudo mdutil -i on /, or sudo mdutil -a -i on for every volume. Search results fill in as the first pass runs.
Questions
Does Finder search work with Spotlight turned off? No. Finder’s search field, Smart Folders and Recents are Spotlight queries, so they return little or nothing for a volume with indexing off. Browsing folders still works normally.
Is it safe to enable locate on a Mac? It is part of macOS and only records names of files that are already publicly readable. It adds a weekly background job that rebuilds its list.
Will turning off Spotlight make my Mac faster? Rarely by much. After the first pass, indexing is light work. Turning it off saves little and costs you search in Finder, Mail and Spotlight.
How do I turn Spotlight indexing back on?
Run sudo mdutil -i on / in Terminal, and remove the disk from Search Privacy if it is listed there.