mdfind for big files on a Mac: 0.03 seconds against 33, and the 7 of 14 test files Spotlight found
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
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 was | Spotlight found it? |
|---|---|
| ~/Downloads | yes |
| ~/Documents | yes |
| ~/Desktop | yes |
| ~/Library/Application Support/… | yes |
A project folder, and inside its node_modules | yes, both |
| /Users/Shared | yes |
| ~/Library/Caches/… | no |
| ~/Library/Mail/… | no |
| ~/Library/Messages/Attachments/… | no |
A hidden folder in home (~/.name) | no |
| /tmp | no |
| ~/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):
| Method | Time | Files found |
|---|---|---|
mdfind -onlyin ~ 'kMDItemFSSize > 104857600' | 0.56 s the first time, 0.03 s repeated | 52 |
/usr/bin/find ~ -xdev -type f -size +100M | 32.2 s and 34.5 s | 99 |
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
| Folder | Files missed | Size on disk |
|---|---|---|
| Under ~/projects | 15 | 4.96 GB |
| Under ~/Library | 21 | 4.39 GB |
| ~/.android | 2 | 2.26 GB |
| ~/.vscode | 5 | 1.57 GB |
| ~/.Trash | 3 | 0.71 GB |
| ~/.local | 2 | 0.50 GB |
| ~/.gradle | 2 | 0.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.
kMDItemFSSizereported Docker.raw at 245,106,737,152 bytes (228 GiB). Its physical size was 2,652,905,472 bytes (2.5 GiB). A ranking bykMDItemFSSizeputs it first; usekMDItemPhysicalSizefor 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;
stata 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,.xcarchiveand.dSYMbundles), whichfind -type fdoes not list. AddingkMDItemContentTypeTree != "public.folder"did not remove them in our test (the count stayed 46), so do not rely on that filter.
When to use which
- Quick look at documents, downloads, desktop and project folders:
mdfind, answer in under a second. - Anything under
~/Library, hidden folders,/tmpor developer folders:findor a disk tool. See ncdu, dust, gdu and du on one 30 GB folder for timings. - If Spotlight looks wrong: check
mdutil -s /; a rebuild is covered in the Spotlight index article.
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 MacSources and method
man mdfind,man mdls,man find,man stat; attribute nameskMDItemFSSize,kMDItemPhysicalSize,kMDItemFSName,kMDItemContentTypeTreeread withmdlson 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
mdfindreturned 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.