Finding a file when you only remember part of the name
· 6 min read
If you remember a piece of a filename but not the start of a word in it, Spotlight will draw a blank. It matches from the beginning of words, so port finds report-q3.pdf only because report is a word there; eport finds nothing. The fix is Finder search with the Filename contains option, which matches anywhere in the name, or mdfind -name in Terminal, which does the same thing without the clicking.
That covers most cases in about twenty seconds. The rest of this is the order to try things in when it does not.
Why the fragment fails
macOS splits a filename into words before indexing it. The split happens at spaces, hyphens, underscores, dots and similar separators, and each resulting word is matched from its start. So for Acme_invoice_2024-final.pdf, the searchable words are roughly Acme, invoice, 2024, final and pdf, and any of those work as a prefix: inv, 20, fin.
What does not work is a fragment that starts mid-word. voice is inside invoice and will not match. Neither will me_inv, because it crosses a separator.
Before changing anything, try a different word from the name. That solves it more often than people expect, and it costs one attempt.
The Finder search that matches anywhere
Finder reads the same index but will do substring matching if you ask.
- Press Command-F in any Finder window. From another app, Command-Option-Space opens a Finder search window directly.
- Type your fragment. A menu drops down under the search field with suggestions.
- Choose the Filename contains “your fragment” entry. This is the one that matches anywhere in the name. It has to be chosen each time; it does not stick.
- Check the scope bar under the toolbar. If it says the name of a folder instead of This Mac, click This Mac.
- Press Command-2 for list view, and turn on View, Show Path Bar so each result shows where it lives.
If Finder starts every search in the current folder and you would rather it searched the whole disk, change it once: Finder in the menu bar, Settings, Advanced, When performing a search, choose Search This Mac.
Two things Finder leaves out unless told otherwise: your ~/Library folder and system files. Click the plus button at the right of the search bar, choose System files in the first pop-up (it may be under Other), and set it to are included.
Build the search from what you do remember
When the fragment is too common to be useful, or you cannot recall any of the name, search on the things you do remember instead. Names are only one attribute among many.
Click the plus button to add criteria, and combine them:
- Kind. Document, PDF, Image, Movie, Music, Presentation. This alone often cuts a result list by ninety percent.
- Created date or Last modified date, set to “within last” a number of days. You usually know roughly when.
- Last opened date, which is the one people forget and the one that matches how you actually remember files.
- File size, useful for “it was the big one”.
- Name, with its own begins with, ends with, is or contains options.
Hold Option while clicking the plus button to add a nested group, headed Any, All or None of the following are true. That is how you express “a PDF or a Word file, modified in the last month, that is not in Downloads”.
When you have a combination that works, click Save. It becomes a Smart Folder, and Finder offers to put it in the sidebar. A saved search for “documents I opened in the last week” earns its place quickly.
Terminal, when Finder is too slow or too polite
mdfind queries the same index from the command line, and its -name flag matches anywhere in the name, so it does the fragment job without any menu choosing:
mdfind -name voice
Confine it to one folder tree:
mdfind -onlyin ~/Documents voice
If the index has not caught up, or the file is somewhere the index does not cover, find reads the disk directly:
find ~ -iname "*voice*" 2>/dev/null
-iname ignores case and the asterisks make it a substring match. This is slow on a full disk because it walks every folder rather than consulting an index, and it is thorough for exactly the same reason. Terminal will ask for permission the first time it reaches into Desktop, Documents or Downloads.
To search a specific external drive, point it at the volume:
find /Volumes/Archive -iname "*voice*" 2>/dev/null
Narrowing a list you cannot read
Sometimes the search works and returns two hundred plausible files. Do not open them one at a time.
Select the first result and press Space for Quick Look, then use the arrow keys to move down the list. The preview updates as you go, so you can rule out fifty files in about fifteen seconds. Press Space again or Escape to close it, and Command-Shift-F for full screen if the previews are too small to judge.
In list view, click the Date Last Opened column heading to sort by it. If you had the file open recently, it rises to the top and the search is over.
When the name is not really the problem
If nothing turns up and you are certain the file exists, the fragment may not be at fault. Three places are excluded by design rather than by settings: inside packages such as the Photos library and the Mail store, anything on an external drive that is not currently plugged in, and hidden files whose names begin with a dot. Toggle the last of those with Command-Shift-Period in a Finder window.
For the first two, the tool has to keep its own record rather than asking Spotlight. Everywhere reads every filename on the Mac once, then narrows the previous result set on each keystroke, and it matches anywhere in a name rather than at word boundaries, so a fragment behaves the way you expect. It also lists files on external drives that are currently unplugged, dimmed and labeled with the drive to connect. It searches names and paths only, so if the fragment you remember was a phrase from inside the file, Spotlight’s content index is what you want.
Two related cases have their own answers: Spotlight cannot find a file you know exists when the index or a setting is at fault, and Files on an unplugged external drive for the drive-in-a-drawer problem. Naming and folder habits that keep a Mac searchable covers making this come up less often.
Questions
Is Finder search case sensitive?
No, and neither is Spotlight or mdfind. On a standard Mac the file system itself is case insensitive too, so Report.pdf and report.pdf cannot both exist in the same folder. Drives formatted case sensitive behave differently, but that is rare outside development machines.
Can I search for two fragments at once?
In Finder, add a second Name criterion with the plus button and leave the group set to All. In Terminal, chain the query: mdfind -name voice | grep -i 2024 filters the first result list by the second fragment.
Why do results appear and then disappear as I type? Finder search is live. It re-runs the query on each keystroke and reorders the list as new matches arrive from the index, so rows can shift under the pointer for the first second. Wait until typing stops before clicking.
What if I remember the folder but not the file? Open that folder, press Command-F, and click the folder name in the scope bar rather than This Mac. Then sort by Date Last Opened and use Quick Look. A folder-scoped search with no search term at all is a valid way to list everything and sort it.