How to search inside files on a Mac

The short answer

Spotlight and Finder both search the text inside your files, not just their names. Press ⌘ Space and type a phrase from the file. For more control, search in Finder.

With Spotlight

  1. Press ⌘ Space.
  2. Type a few words that are inside the file, like signed March 3.
  3. Press ⌘ Return to show the highlighted file in Finder instead of opening it.

With Finder, for more control

  1. Open a Finder window and press ⌘ F.
  2. Click This Mac next to Search: to look everywhere, not only in the current folder.
  3. Type your words. Finder looks at both names and contents. To match only names, choose Name matches from the suggestions under the field.
  4. To match only what is inside: click +, open the first pop-up menu, choose Other…, select Contents, then type your words in the new rule.
  5. Click Save to keep the search as a Smart Folder that updates by itself.

From Terminal

mdfind asks the same index Spotlight uses. Put the words in quotes; it lists the files that contain every one of them:

mdfind "signed March 3"
mdfind -onlyin ~/Documents "invoice 2026"
mdfind -name "lease"

The last line searches names only.

If nothing shows up

  1. Open System Settings → Spotlight (on older versions: Siri & Spotlight) → Search Privacy (or Spotlight Privacy). If the folder or drive is listed there, Spotlight skips it. Select it and click –.
  2. For an external drive, type mdutil -s /Volumes/NAME in Terminal, using the drive’s name. If indexing is off, turn it on with sudo mdutil -i on /Volumes/NAME.

Still missing? Rebuild the Spotlight index.

Words in photos and screenshots

When the words you remember are only in a photo or a screenshot, try Truffle. It reads the words in pictures, sees what's in photos and videos, and does all of it on your Mac. It doesn't read scanned PDFs on a Mac yet.

Truffle finding a photo, IMG_2210.HEIC, for the search “the receipt for the navy sofa”. It comes first under “Closest matches”: the photo shows a receipt, and “receipt”, “navy” and “sofa” are written in it.
The receipt is a photo, so its words are only in the picture. Truffle read them on the Mac.

Free. Your files are searched on your own computer, not uploaded to us.

Apple, Mac, macOS, Finder and Spotlight are trademarks of Apple Inc., registered in the U.S. and other countries and regions. PageDuo is not affiliated with, endorsed or sponsored by Apple.