I'm used to using various flags to modify the results of Google searches, to only show results from a particular site, or only certain kinds of files.
For example you can restrict Spotlight searches to only look for pdf files like this example, when I'm looking for a pdf cheatsheet for using YUI's grid system css framework on my computer.
YUI grid kind:pdf
I'd be amazed if Apple's Spotlight didn't have loads of other handy flags to fine tune a search in the same way – what tricks do you use, or where do you look to find more tips to improve your Spotlight-fu?
Best Answer
Spotlight menu and Finder
name:filename
kind:kindle
(kind:mobi
and*.mobi
cannot be used)kind:image
date:today
(date:week
anddate:month
don't work)date:12/31/11
(other formats likedate:2011-12-31
don't work)date:12/1/11-12/31/11
kind:mp3 AND bitrate:<192000
Common metadata attribute keys
mdls -name $attribute $file
shows the value of a single attribute andmdls $file
lists all attributes.kMDItemContentType
: the uniform type identifier likepublic.plain-text
kMDItemContentTypeTree
: the UTI and its parent UTIskMDItemDisplayName
: the name of a file without an extension if its extension is set to be hiddenkMDItemDurationSeconds
: for example the duration of audio or video fileskMDItemFinderComment
: the Spotlight comment that can be set in Finder's information windowskMDItemFSContentChangeDate
: modification datekMDItemFSCreationDate
: creation datekMDItemFSInvisible
: the visibility of a filekMDItemFSName
: the name of a file with a filename extensionkMDItemFSSize
: the size of a file in byteskMDItemKind
: a kind description like HTML documentkMDItemLastUsedDate
: date last openedkMDItemNumberOfPages
: for example the number of pages in a PDF filekMDItemPageWidth
: for example the width of a PDF document in pointskMDItemPath
: the full path of a filekMDItemTextContent
: contents of the filekMDItemTitle
: for example the title of a PDF document or a websitekMDItemURL
: for example the URL of a webloc filekMDItemWhereFroms
: a URL a file was downloaded frommdfind query expressions
mdfind . -onlyin ~/Pictures
mdfind 'kMDItemFSContentChangeDate == $time.this_week(-1)'
mdfind 'kMDItemTextContent == "*expose*"cd'
(ignore case and diacritics)mdfind 'kMDItemFSSize >= 5000 && kMDItemFSSize <= 5005)'
mdfind 'kMDItemFSContentChangeDate >= $time.iso(2012-04-13T13:44Z)'
mdfind 'kMDItemFSCreationDate >= $time.now(-3600)'
mdfind 'kMDItemKind == "*movie" && kMDItemPixelHeight >= 720'