Everywhere All articles Download

Command line and power tools

Using mdfind

Updated 2026-07-31 · 5 min read

mdfind queries the same index as Spotlight but without the ranking, the blending or the interface deciding what you may see.

The basics

mdfind "invoice"

Searches names and contents everywhere. To search only names:

mdfind -name invoice

To restrict to a folder — including folders Spotlight's interface hides:

mdfind -onlyin ~/Library "invoice"

That -onlyin trick is the single most useful thing here: the index frequently contains files the Spotlight menu refuses to display.

Counting instead of listing

mdfind -count "kMDItemContentType == 'com.adobe.pdf'"

Query syntax

Structured queries use metadata attributes:

mdfind "kMDItemFSSize > 1073741824"
mdfind "kMDItemContentTypeTree == 'public.image'"
mdfind "kMDItemFSName == '*.key'c"
mdfind 'kMDItemContentModificationDate >= $time.today(-7)'

The trailing c makes a comparison case-insensitive. $time supports today, now, this_week, this_month with optional offsets.

Combine with && and ||:

mdfind "kMDItemContentTypeTree == 'public.image' && kMDItemFSSize > 10485760"

Finding attribute names

To see every attribute Spotlight holds for a file:

mdls ~/Downloads/somefile.pdf

That is the reference — whatever mdls prints, you can query with mdfind.

Live mode

mdfind -live "invoice"

Keeps running and updates as files change. Useful for watching a folder during an import.

Limitations, inherited

mdfind reads Spotlight's index, so it cannot see what was never indexed: excluded folders, package contents, unmounted volumes, unindexed formats. It is a better interface to the same data, not more data.

Common questions

Is mdfind faster than Spotlight?

It queries the same index, so lookup speed is similar. It feels faster because it does no ranking and no content blending.

How do I search only filenames with mdfind?

mdfind -name term, or query kMDItemFSName directly for exact patterns.

Find any file before you finish typing

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.

Download for Mac

Related

© 2026 Caretopia Network Private Limited Everywhere for Mac Articles Privacy Support