How to find a file on a Mac when you forgot the name

To find a file on a Mac, press Command-Space and type any part of its name. Spotlight searches names and, for most document types, the text inside them. If that fails, open a Finder window, press Command-F, and search by what you do remember instead of the name: the kind of file, the date you last opened it, or a phrase inside it. If both come back empty, the file is probably outside the Spotlight index, and the Terminal commands mdfind and find will tell you which.

That is the short version. The rest of this guide explains which tool to reach for depending on what you still remember, how to read an empty result, and the one setting that most often hides files that are sitting right there. The commands below were run on macOS 27.0.1 on October 9, 2026.

Start from what you remember, not from the name

A forgotten name is the most common reason a search fails, and it is also the weakest identifier a file has. macOS records a lot more than the name: when the file was created, when it was last opened, what kind of document it is, which app made it, and for downloads, the web address it came from. Any one of those is a better search key than a half-remembered word.

Before typing anything, write down what is actually known. Usually it is two or three of these:

What you remember Best tool Example
Part of the name Spotlight Command-Space, type invoice
A phrase inside the file Spotlight or Finder search type the phrase in quotes
Roughly when you used it Finder search, Last opened date within last 14 days
What kind of file it was Finder search, Kind PDF, Presentation, Image
Which site or chat it came from mdfind with kMDItemWhereFroms "*slack*"
The folder it was probably in find in Terminal find ~/Documents -iname "*budget*"

Combining two of these is usually enough. "A PDF opened in the last two weeks" narrows a home folder of tens of thousands of files down to a list short enough to scan by eye. A name fragment on its own often does not.

Spotlight: the fastest first try

Spotlight is the system-wide search box. Apple describes the basic use plainly:

To open Spotlight, press Command-Space bar and start typing. Results appear instantly, with the best match at the top. Source: support.apple.com

A few details on the same Apple page make Spotlight more useful for lost files than it first appears:

  • Press Space on a result to preview it without opening it. This is the quickest way to confirm that a match is the file you want.
  • Hold Command with a result selected to locate the file in the Finder.
  • Press the Up Arrow to recall a previous search.

Spotlight also accepts a few structured words. Typing kind:pdf limits results to PDFs, and on the test machine kind:pdf date:this week, run through mdfind -interpret, which uses the same parser, returned 3 files in the Downloads folder. That syntax is handy, but the parser follows the system language, so the keywords can differ on a Mac set to another language.

Where Spotlight falls short is breadth. It mixes apps, settings, web suggestions and files in one list, ranks them by its own guess, and shows only a handful of file results. When the file is one of many similar documents, move to Finder.

Finder search: scope and attributes

In any Finder window, Command-F opens a search with two important controls under the search field.

The first is the scope: "This Mac" or the name of the folder you were in. If the file was in Documents and the search is running against This Mac, the right result is buried among system and app files. If it is running against the current folder and the file is elsewhere, it will not appear at all. Which one is used by default is set in Finder > Settings > Advanced, under "When performing a search." The choices are Search This Mac, Search the Current Folder, and Use the Previous Search Scope. Many failed searches are simply the wrong scope.

The second is the plus button on the right of the search bar. Each press adds a criteria row. The useful ones for a forgotten name are:

  • Kind (PDF, Image, Presentation, Spreadsheet)
  • Last opened date (within the last N days)
  • Created date and Last modified date
  • Other..., which opens a long list of metadata attributes, including file size and the app that created it

Rows combine with AND, so "Kind is PDF" plus "Last opened date is within last 14 days" returns only files that match both. Clicking Save turns the whole search into a Smart Folder that sits in the sidebar and updates itself. For anything you go looking for repeatedly, such as "spreadsheets touched this month," a saved search is faster than rebuilding the criteria every time.

Before building criteria by hand, it is worth opening Recents in the Finder sidebar. It is itself a saved search for files opened recently, sorted by date, and it is often the quickest route back to something used yesterday or last week. Sorting the list by Kind and scanning only the PDFs or spreadsheets takes a few seconds and needs no remembered name at all.

Finder search uses the same index as Spotlight. If Spotlight cannot see a file, Finder search will not see it either. That is the point at which Terminal becomes useful, because one of its tools does not depend on the index at all.

Terminal: mdfind, find, and locate

Three commands are built into macOS. They behave differently, and knowing why saves a lot of guessing.

Command Uses the Spotlight index Speed Sees unindexed folders
mdfind Yes Instant No
find No, walks the disk Slow on large folders Yes
locate No, uses its own database Instant Only what was there when the database was built

mdfind is Spotlight from the command line, with more control. mdfind -name invoice matches names only. -onlyin ~/Documents limits the scope. It can also query any metadata attribute directly. Files downloaded through a browser usually carry the address they came from in kMDItemWhereFroms, and on the test machine this query found 169 files in Downloads that came from a Google address:

mdfind -onlyin ~/Downloads 'kMDItemWhereFroms == "*google*"cd'

The c and d after the quote make the match ignore case and accents. Replace google with the name of a chat service, a client's domain, or a file-sharing site. To see which attributes a known file carries, run mdls on it.

find ignores the index and reads the folders themselves. It is slower, but it is the reliable check when you suspect the index is the problem:

find ~/Documents -iname "*budget*" -mtime -14

This lists files under Documents whose name contains "budget" in any case and that were modified in the last 14 days. Keep the starting folder narrow. Running find / walks the whole disk and prints a stream of permission errors.

locate reads a database that macOS does not build by default. Its manual says the database "is recomputed periodically," but the job that builds it, /System/Library/LaunchDaemons/com.apple.locate.plist, is switched off on a fresh install. On a Mac where it was turned on once and then left alone, the database can be months old, so a file created last week will not be in it. Of the three, it is the least useful for a recent file.

When nothing turns up: check the index

If Spotlight and Finder return nothing but find locates the file, the index is missing it. Apple's support article on indexing describes how the index is built and how to fix a stuck one:

Depending on the amount of data on your device, Spotlight indexing can take hours or even days. Incremental updates after that are much faster. Source: support.apple.com

Work through these in order:

  1. Is indexing still running? After a macOS update or a migration, the index rebuilds. Pressing Command-Space shows a progress indicator while it runs. Searching before it finishes gives partial results.
  2. Is the folder excluded? Open System Settings > Spotlight, scroll down and click Search Privacy (on some versions, Spotlight Privacy). Anything in that list is invisible to Spotlight and Finder search. External drives and project folders are often added here to save battery and then forgotten.
  3. Is the content type turned on? The same Spotlight settings pane lists categories of results. If a category is off, those files do not appear in Spotlight.
  4. Rebuild the folder's index. Apple's method: add the disk or folder to the Search Privacy list, wait a few seconds, remove it again, and click Done. Spotlight then reindexes that location.

One trap when checking from Terminal: mdutil -s / reports "Indexing disabled." on a normal Mac. That is the sealed, read-only system volume. Your files live on the data volume, and mdutil -s /System/Volumes/Data is the command that shows whether indexing is on for them. On the test machine it returned "Indexing enabled."

If find cannot locate the file either, it is not on this disk under that name. Check the Trash, any external drive that is not connected, and cloud folders where the file may be stored online only.

Making the next search shorter

Most lost-file searches are a symptom of files landing in places that were never chosen: Downloads, Desktop, or wherever an app saved them by default. Search fixes the moment, but two habits reduce how often it is needed.

The first is to keep a small number of named places per project and move files into them on the day they arrive. The second is to save the searches you repeat. A Smart Folder for "PDFs from the last 30 days" or "anything with the client's name in it" turns a search into a place.

Finder has limits here. A folder in the sidebar can only show what is physically inside it, so a project whose files are split between Documents, an external drive and a cloud folder needs three separate trips. A file manager with a built-in terminal and its own sidebar can treat those scattered locations as one project, offer search scoped to the folder that is already open, and keep saved searches next to the folders they belong to. The features page lists what one such tool covers, and the comparison page sets it against Finder and other file managers so the trade-offs are visible before installing anything. On that tool, everything that runs on the Mac itself is free, and pricing applies only to using it from an iPhone or iPad.

What to change first

Check the search scope in Finder > Settings > Advanced, since it explains more failed searches than any other single setting. Then run find once on the folder you expect the file to be in, which tells you in one step whether the problem is the file or the index. If files keep scattering across several places, a sidebar that groups them by project, such as the one in Atriens, shortens the next search before it starts.

Frequently asked questions

Why does Spotlight show the file but Finder search does not?

The two use the same index, so the usual cause is scope. Finder may be searching only the current folder while Spotlight searches the whole Mac. Change the scope at the top of the search results to This Mac, or set the default in Finder > Settings > Advanced.

How do I find a file I downloaded but cannot remember the name of?

Open Downloads, press Command-F, and add a "Last opened date" or "Created date" row for the last few days. If you remember the site, run mdfind with kMDItemWhereFroms and part of the web address in Terminal. Browsers usually record the source address on each downloaded file.

Can I search for text inside a file on a Mac?

Yes. Spotlight and Finder search include the text inside most document types, including PDFs and plain text, as long as the folder is indexed. Put a phrase in quotes for an exact match. If text search fails for a known file, check that its folder is not in the Spotlight Search Privacy list.

Is it safe to rebuild the Spotlight index?

Rebuilding only recreates the search index, not your files. Apple's documented method is to add the disk or folder to the Search Privacy list in Spotlight settings, then remove it. Search results are incomplete while indexing runs, which can take hours on a large disk.

What is the fastest Terminal command to find a file by name?

mdfind -name followed by part of the name is the fastest, because it reads the Spotlight index. If the folder might not be indexed, use find with -iname on that folder instead. It is slower but reads the disk directly.

Back to all posts