mdfind <query>

Finds files matching a given query

Arguments

NameDescription
query

Options

NameDescription
--help, -hShow help for mdfind
-0Prints an ASCII NUL character after each result path
-liveProvide live-updates to the number of files matching the query
-countOutput the total number of matches, instead of the path to the matching items
-onlyin <dir>Limit the scope of the search to <dir>
-name <filename>Search for matching file names to <filename> only
-reprintReprint results on live update
-s <folder>Show contents of smart folder ~/Library/Saved Searches/<folder>.savedSearch
-literalForce the provided query string to be taken as a literal query string, without interpretation
-interpretForce the provided query string to be interpreted as if it had been typed into the Spotlight menu