Skip to content

How to Search Inside Files on a Mac: Spotlight, Finder, mdfind and Search by Meaning

Spotlight, the Finder, mdfind and smart folders find words inside your files. What each does well, and how to find a file you can only describe.

Jungle Labs2 min read

On this page2 min left
In short
  • Spotlight, the Finder and mdfind find a file when you type a word printed in it.
  • They miss files described in other words, and scans without a text layer.
  • Inner Files (our app) searches by meaning, on the Mac.

You remember the plumber’s quote. You don’t remember that it is called devis_signed_v3.pdf. macOS can search inside files, as long as you type a word that appears in them.

Spotlight

Press ⌘Space and type. Spotlight looks at file names and at the text of the documents macOS indexes: PDFs, Pages and Word files, plain text, mail. ⌘Return shows the result in the Finder instead of opening it, and kind:pdf limits the list to PDFs (Apple’s Spotlight guide).

The Finder and smart folders

⌘F in a Finder window searches the same index and lists every match with its folder, which you can sort. The + button adds criteria: Kind, Last opened date, Contents.

File â€ș New Smart Folder keeps a search in the sidebar. It updates itself and moves nothing.

mdfind in Terminal

  • mdfind "kitchen worktop" lists the files that contain both words.
  • mdfind -onlyin ~/Documents lease searches one folder.
  • mdfind -name invoice looks at names only.

When the word isn’t in the file

All of these match letters. Pick a search below: two describe the file in other words, one uses words printed in it.

Same file, two ways of searching
devis_signed_v3.pdfNo result

Quote for the renovation of the kitchen: units, worktop, fitting. Total incl. VAT €12,400

Not in the file: last, year

Spotlight and the Finder look for every word you type.

Three cases come up all the time:

  • Other words. You type "quote", the PDF says "estimate".
  • Scans. A scanned page is an image; without a text layer, the index has nothing to read.
  • Another language. You search in English for a letter written in French.

Search by meaning

Inner Files reads the folders you pick, on your Mac: the text of documents, and the text of scans and photos through Apple’s Vision framework. A language model built into macOS then indexes what each passage says. In ⌘K, you describe the file:

esc
SearchAsk

“the kitchen quote from last year”, “electricity bills”, “screenshot with a red chart”


search by meaning · on your Mac
Try

The same index answers questions, and every answer points to the file and page it comes from:

esc
SearchAsk

search by meaning · on your Mac

Search by meaning is free in two folders. A one-time purchase opens it to all of them. Nothing is sent anywhere.

At a glance

ToolText inside filesFinds by descriptionScans and imagesSaved searchPrice
SpotlightYesNoRecent macOSNoFree
FinderYesNoRecent macOSSmart foldersFree
mdfindYesNoSame as SpotlightIn a scriptFree
Inner FilesYesYesYes, read on the MacSmart collectionsFree in 2 folders, then paid once

Questions

How do I search for text inside files on a Mac?
Press Command-Space and type a word from the document. Spotlight searches the names and the text of the files macOS indexes, PDFs and office documents included. In a Finder window, Command-F searches the same index and lists every result with its folder.
Why doesn’t Spotlight find a file I know is there?
Spotlight needs the words you type to be written in the file. It misses a document described in other words, a scan without a text layer, and anything in a folder excluded in Spotlight’s privacy settings.
Can I search my Mac by describing a file?
Not with the built-in tools. Inner Files indexes what your documents say, on your Mac, so a description such as the kitchen quote from last year finds an estimate that never uses the word quote.
All articles