mdfind for big files on a Mac: 0.03 seconds against 33, and the 7 of 14 test files Spotlight found

By the Zofle team · 17 November 2026 · 5 min read

Spotlight big-file search compared with find

mdfind can list every file over 100 MB on a Mac in a fraction of a second. find takes half a minute for the same job. The catch is that Spotlight only knows what it indexed. We planted 120 MB control files in 14 places on one Mac and Spotlight found 7 of them, then we compared a whole-home search against find.

The one-line query

bash
mdfind -onlyin ~ 'kMDItemFSSize > 104857600'
mdfind -0 -onlyin ~ 'kMDItemPhysicalSize > 104857600' | xargs -0 stat -f '%b %N' | sort -rn | head

The first prints every path over 100 MB (104,857,600 bytes). The second ranks by size on disk: stat -f %b is 512-byte blocks, so multiply by 512. Here it printed in 0.04 seconds.

Setup

Mac mini (Mac16,10, Apple M4), macOS 27.0.1, internal SSD, 957,088 files under the home folder, Spotlight indexing on (mdutil -s /). We made one 120 MB random file (dd if=/dev/urandom bs=1m count=120) in each folder below, waited a few minutes, and asked Spotlight for it by name (kMDItemFSName). We checked again later; the answer did not change. All test files were deleted afterwards.

What Spotlight found: 7 of 14

Where the 120 MB file wasSpotlight found it?
~/Downloadsyes
~/Documentsyes
~/Desktopyes
~/Library/Application Support/…yes
A project folder, and inside its node_modulesyes, both
/Users/Sharedyes
~/Library/Caches/…no
~/Library/Mail/…no
~/Library/Messages/Attachments/…no
A hidden folder in home (~/.name)no
/tmpno
~/Library/Group Containers/…no
~/Library/Containers/… (a new folder)no

That is 13 rows because the project folder and its node_modules count as two of the 14 files. The important line is the Messages and Mail rows. A Spotlight query cannot rank your Messages attachments or your Mail downloads by size, because those files are not in the file index. Our first plan for this article was one query across Messages, Mail and Downloads; the test killed it. Use the Messages review list in System Settings instead, as in Messages on a Mac and Mac Mail storage.

Spotlight is not blind to all of ~/Library: it did return Docker's Docker.raw from ~/Library/Containers/com.docker.docker, so older, already indexed files in that folder are known. A new folder in the same place was not. Treat coverage as patchy, not as a rule you can learn.

Whole-home search against find

The same question, every file over 100 MB under the home folder (the 12 control files inside home were still in place):

MethodTimeFiles found
mdfind -onlyin ~ 'kMDItemFSSize > 104857600'0.56 s the first time, 0.03 s repeated52
/usr/bin/find ~ -xdev -type f -size +100M32.2 s and 34.5 s99

find was about 60 times slower than the first mdfind run and found nearly twice as many files. By size on disk, find saw 32.0 GB and mdfind 16.5 GB. Of the 99 files, 12 were our controls, and Spotlight returned 6 of them. Spotlight also returned 8 items find -type f does not list (bundles, below), so 55 files were found by find only.

What the 55 missed files were

FolderFiles missedSize on disk
Under ~/projects154.96 GB
Under ~/Library214.39 GB
~/.android22.26 GB
~/.vscode51.57 GB
~/.Trash30.71 GB
~/.local20.50 GB
~/.gradle20.35 GB

The biggest misses, apart from our controls: an Android emulator disk (~/.android/avd/zofle_sd.avd/userdata-qemu.img.qcow2, 1.73 GB), a git pack file (1.16 GB) and a half-written git tmp_pack (0.71 GB), and Siri model disk images inside the iOS Simulator (0.77 GB and 0.66 GB). These are exactly the kind of files people hunt for, and the Spotlight query skipped them. The ~/Library group includes our 5 control files there, about 0.6 GB.

Two traps in the numbers

  • Logical size is not space used. kMDItemFSSize reported Docker.raw at 245,106,737,152 bytes (228 GiB). Its physical size was 2,652,905,472 bytes (2.5 GiB). A ranking by kMDItemFSSize puts it first; use kMDItemPhysicalSize for what the disk really holds. See Docker.raw says 228 GB, 4.2 GB is real.
  • The index can be behind. Spotlight's physical size for Docker.raw was 2.65 GB; stat a little later said 3.07 GB, because the file was growing. Spotlight updates on its own schedule.
  • Bundles count as one item. Eight extra results were folders (.app, .xcarchive and .dSYM bundles), which find -type f does not list. Adding kMDItemContentTypeTree != "public.folder" did not remove them in our test (the count stayed 46), so do not rely on that filter.

When to use which

Zofle scans the folders itself, so the hidden and Library items above show up in the same list, sorted by size on disk, with Undo for anything you move to the Trash.

Zofle finds big files in Library, hidden and developer folders that a Spotlight search skips, and moves them to the Trash with Undo.

Download Zofle for Mac

Sources and method

  • man mdfind, man mdls, man find, man stat; attribute names kMDItemFSSize, kMDItemPhysicalSize, kMDItemFSName, kMDItemContentTypeTree read with mdls on the test Mac.
  • Run 17 November 2026 on one Apple M4 Mac mini, macOS 27.0.1, one home folder of 957,088 files. One machine, one day: your index coverage will differ. Control files were random data, created fresh and removed afterwards; "found" means mdfind returned the file name a few minutes after creation and again later. The 12 control files were still present during the whole-home comparison.

Zofle Pro news

People signing up now will get Zofle Pro, with more features, for free when we launch it.

One email when it's ready. No spam, ever.