Vocabulary spotlight Inputs Outputs Word description Finds files matching a given query.
mdfind [-live] [-count] [-onlyin directory] [-name fileName] query The mdfind command consults the central metadata store and returns a list of files that match the given metadata query. The query can be a string or a query expression.
Spotlight Keywords These can be included in the query expression to limit the type of documents returned:
Applications kind:application, kind:applications, kind:app Audio/Music kind:audio, kind:music Bookmarks kind:bookmark, kind:bookmarks Contacts kind:contact, kind:contacts Email kind:email, kind:emails, kind:mail message, kind:mail messages Folders kind:folder, kind:folders Fonts kind:font, kind:fonts iCal Events kind:event, kind:events iCal To Dos kind:todo, kind:todos, kind:to do, kind:to dos Images kind:image, kind:images Movies kind:movie, kind:movies PDF kind:pdf, kind:pdfs Preferences kind:system preferences, kind:preferences Presentations kind:presentations, kind:presentation
Date Keywords These can be included in the query expression to limit the age of documents returned:
date:today $time.today() date:yesterday $time.yesterday() date:this week $time.this_week() date:this month $time.this_month() date:this year $time.this_year() date:tomorrow $time.tomorrow() date:next month $time.next_month() date:next week $time.next_week() date:next year $time.next_year()
Boolean Operators By default mdfind will AND together elements of the query string.
| (OR) to return items that match either word, use the pipe character: stringA|stringB - (NOT) to exclude documents that match a string: -string == equal != not equal < and > "less" or "more than" <= and >= "less than or equal" or "more than or equal"
Examples Return all files that have been modified today
"date:today" mdfind
Return all files that have been modified in the last 3 days
"kMDItemFSContentChangeDate >= $time.today (-3)" mdfind
Returns files with particular attributes
"com.microsoft.word.doc" "kMDItemContentType" attr== mdfind
Look for files with a particular file name
"Finding Joy in Combinators.pdf" "kMDItemFSName" attr== mdfind
Look for terms in documents
"Document cocoa.messages selector" mdfind
Return all files in the users home folder that have been modified in the last 3 days
"~" [ "kMDItemFSContentChangeDate >= $time.today (-3)" mdfind ] with-directory
Notes This word uses the
current-directory to restrict the search, choosing to search from the root ('
/ ') if not set.
Definition
This documentation was generated offline from a
load-all
image. If you want, you can also
browse the documentation from within the UI developer tools . See
the Factor website
for more information.
Factor 0.101 x86.64 (2285, heads/master-4a71effa9e, Nov 22 2024 17:20:18)