Finding specific things
A normal search returns files and folders mixed together. To see only folders, add a kind filter in Finder or Spotlight, or use a Terminal query that asks for directories.
| Where | What to do |
|---|---|
| Finder | Search, click + below the search field, set Kind to Folder |
| Spotlight menu | Type kind:folder and part of the name |
| Terminal, with the index | mdfind with a folder content-type test |
| Terminal, no index | find with -type d |
Finder is the most visual, and Spotlight is the quickest. Terminal is for when you want a plain list you can copy from. All of them but find use Spotlight's index, so they share its blind spots, covered near the end.
The result list now holds folders only. Folder sits in the same menu as Application, Document, Image and the other kinds.
To reuse the search, click Save below the search field. It becomes a Smart Folder, which Apple's guide says you can add to the sidebar, and which updates itself as folders come and go. If you want the search limited to one place, click that folder's name in the bar under the toolbar before saving. The post on Finder search tips lists more criteria you can combine.
Open Spotlight with ⌘Space and type:
kind:folder invoices
Apple's guide lists kind:folder (or kind:folders) among the Spotlight keywords for macOS Sequoia and later, and you can put it before or after the name. One detail to expect: applications are not counted as folders, even though they are folders on disk. Run through mdfind -interpret, which reads text the way the Spotlight menu does, kind:folder utilities found /Applications/Utilities and kind:folder xcode found nothing, because Xcode is an app. In macOS Tahoe 26 and later, Spotlight can also offer a Folders category under the search field as you type.
mdfind asks the Spotlight index directly. A folder has the content type public.folder, so this lists folders whose name contains "invoices", ignoring case:
mdfind 'kMDItemContentType == "public.folder" && kMDItemFSName == "*invoices*"c'
Add -onlyin to limit it to one place:
mdfind -onlyin ~/Documents 'kMDItemContentType == "public.folder" && kMDItemFSName == "*invoices*"c'
It returns folders only, no files. The trailing c after the pattern means "case-insensitive", and * is a wildcard on either side. Our mdfind guide explains the query language.
find doesn't use the index. It walks the folders and checks each name as it goes:
find ~ -type d -iname '*invoices*' 2>/dev/null
-type d means directories only, -iname ignores case, and 2>/dev/null hides the "Permission denied" messages. It is slower than mdfind but reaches places the index doesn't, including ~/Library. Unlike the other methods, find also lists application bundles, because to it they are directories. And if macOS asks whether Terminal may access Documents, Desktop or Downloads, allow it, or find will skip those folders.
For a name search that isn't limited to folders, see searching by filename.
If you know the parent folder, start there: give it to mdfind with -onlyin, or put it in place of ~ in the find command. If you only know the folder is somewhere in your home folder, find ~ is the safest net, because it doesn't depend on the index being complete. Give it a more specific pattern than a single letter, or the list will run to thousands of lines. Pipe it through head -50 to look at the first fifty matches before you commit to reading all of them:
find ~ -type d -iname '*invoices*' 2>/dev/null | head -50
Finder and Spotlight searches leave out much of ~/Library, the insides of app packages, and drives Spotlight hasn't indexed, such as some external disks. If a folder you know exists doesn't show up in Finder, try find, or open Go > Go to Folder… and type the path.
In Everywhere, click the Folders filter button, or type folder:invoices. Both list only folders whose names match, each shown with the folder it sits in. Like find, it treats app bundles as folders, and because it keeps its own index of names, folders inside ~/Library and hidden folders appear too; those in Desktop, Documents and Downloads need Full Disk Access.
In a Finder window, search, click the + below the search field, and set Kind to Folder. In Spotlight, type kind:folder with part of the name.
Run find ~ -type d -iname '*name*' 2>/dev/null to walk the disk, or use mdfind with a public.folder content-type test for a faster index search.
Spotlight treats an application bundle as an app, not as a plain folder, so kind:folder leaves it out. Search kind:app for applications instead.
Yes. After setting the criteria, click Save below the search field to make a Smart Folder that updates itself, and keep Add To Sidebar selected if you want it in the sidebar.
Everywhere keeps track of every file on your Mac, including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Version 2.20.3 · macOS 13+ · 4.7 MB · notarised