Finding a file when you only remember the folder it was in
· 6 min read
When the name is gone but you remember where the file lived, stop searching by name. Open the folder, switch to list view and sort by Date Added or Date Last Opened. If the folder has subfolders, run a search scoped to it that contains no name at all, only a kind and a date, such as kind:pdf date:this month, which lists every matching file in the whole tree at once.
If you only half remember the folder, a path filter does the work: Terminal can list every PDF whose path contains “acme”, and so can a search app with a path operator. (When it is the other way round, and a scrap of the name is all you have, finding a file when you only remember part of the name is the post you want.)
Get to the folder first
Finder keeps track of where you have been, which helps when the folder is buried.
- Go, Recent Folders lists the folders you opened lately. The one you remember is often there.
- Go, Go to Folder (Command-Shift-G) takes a typed path such as
~/Documents/Clientsand suggests matching folders as you type. - If you remember the folder’s name but not where it is, find it first. Find a folder by name on a Mac covers the search that returns folders rather than files.
If you opened the file in the last few days, also glance at Recents in the Finder sidebar (Command-Shift-F) before going further. Turn on View, Show Path Bar, then click through the top few results; the path bar at the bottom shows which folder each one is in, and you are looking for the one you remember.
Let the folder sort itself
A folder of three hundred files with no name to type is a sorting problem, not a search problem.
- Open the folder and press Command-2 for list view.
- Press Command-J (View, Show View Options) and tick the columns Date Added, Date Last Opened and Kind.
- Click a column heading to sort by it. Click again to reverse.
Which date to sort by matters more than people expect:
- Date Added is when the file arrived in this folder. A contract from 2019 that you copied in last week sorts as last week here.
- Date Modified is when the contents last changed. Copying a file usually keeps its original modified date, so that same 2019 contract sorts among the 2019 files and you scroll straight past it.
- Date Last Opened is when you last opened it, which is often the way you actually remember a file: “I had it open on Tuesday”.
Then use View, Use Groups, and set Group By to Kind. PDFs, spreadsheets, images and presentations each get their own block, so “it was a spreadsheet” removes most of the folder at a glance. From there, select the first likely file and press Space for Quick Look, and use the arrow keys to move through the previews without opening anything.
The weakness of this approach is subfolders. Option-clicking a folder’s disclosure triangle in list view expands everything inside it, but sorting still happens folder by folder, not across the whole tree.
Flatten the folder with a search that has no name
A Finder search scoped to a folder lists matching files from every level beneath it in one sortable list, and it does not need a name.
- Open the folder and press Command-F.
- In the row under the toolbar, click the folder’s name rather than This Mac. Search inside one folder only covers the scope row and how to make it the default.
- In the search field, type a kind and a date instead of a name, for example
kind:pdf date:this weekorkind:spreadsheet date:this month.
Spotlight’s own keywords include kind:pdf, kind:image, kind:presentation, kind:spreadsheet, kind:folder and kind:document, and dates such as date:today, date:yesterday, date:this week, date:this month and date:this year. Finder’s search field accepts them on recent versions of macOS. If yours turns them into ordinary search text instead, use the plus button to add the equivalent rows: Kind, then Last opened date set to within the last so many days.
Sort the results by Date Last Opened. Select a result and the path bar shows which subfolder it was in, which is often the moment the name comes back to you.
Spotlight from the menu bar (Command-Space) understands the same words, so kind:pdf date:yesterday works there too. It cannot be limited to one folder, though, so it only helps when the date is a stronger memory than the place.
From Terminal, including half-remembered paths
mdfind reads the same index and takes the same keywords:
mdfind -onlyin ~/Documents/Clients/Acme "kind:pdf date:this month"
Terminal is more useful than Finder when you only remember part of the folder’s name or where it sat. List every PDF from this year, then keep the ones whose path contains “acme”:
mdfind "kind:pdf date:this year" | grep -i "acme"
That catches folders called Acme, Acme Ltd 2025 or Old acme work at any depth, along with any PDF that has acme in its own name.
When the folder is not in Spotlight’s index, because it is excluded, on a drive Spotlight does not index, or the index is behind, find walks the disk instead. This lists PDFs modified in the last 30 days anywhere under your home folder whose path mentions acme:
find ~ -ipath "*acme*" -iname "*.pdf" -mtime -30 2>/dev/null
It is slower because it reads every folder, and it is thorough for the same reason.
A search where the path is part of the query
If this is how you usually remember files, by place rather than name, a search app that treats the path as something to type is quicker than either of the above. Everywhere catalogs every file name and path on the Mac once and narrows the list as you type, and its path: operator filters by folder inline. Typing path:acme ext:pdf lists every PDF in any folder whose path includes acme, across the whole Mac, and Command-Return reveals the selected one in Finder. It also lists files on an external drive that is currently unplugged, dimmed and naming the drive to connect, which helps when the folder you remember was on the backup disk in a drawer. It searches names and paths only, not the text inside files.
When the file is no longer in that folder
Sometimes you are right about the folder and the file has simply left it.
It was deleted. Open the Trash, switch to list view and sort by Date Added, which in the Trash generally reflects when items were moved there. Select the file and choose File, Put Back to return it to the folder it came from.
It was overwritten or moved some time ago. If Time Machine is set up, open the folder in Finder, then choose Browse Time Machine Backups from the Time Machine menu in the menu bar if you show it there, or open Time Machine from Applications while that folder’s window is in front. You see that folder as it was at each backup, and can restore the file from the date it was still there.
It was on an external drive. Plug the drive in and search it like any other folder; Spotlight does not keep a record of a drive once it is ejected.
Questions
Why does a file I saved last week sort to the bottom by date? You are probably sorting by Date Modified, and the file kept an older modified date when it was copied in. Sort by Date Added instead.
Can Finder show everything in a folder tree as one flat list?
Close to it. A search scoped to the folder with only a kind in it, such as kind:document or kind:image, lists every match from every subfolder together, and you can sort that list however you like.
Does a folder-scoped search include hidden or Library files? Not by default. Add the System files criterion with the plus button and set it to are included if the folder you remember is inside a Library folder.
What if I remember the folder and roughly what was in the file? Then search the contents instead of the name. A folder-scoped Finder search matches the text inside documents as well as their names, as long as you do not pick the name-only suggestion, so type a phrase you remember from inside the file. Spotlight indexes the text of most documents.