O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

mdfind

Synopsis

mdfind [-live] [-onlyin directory] query

Searches the Spotlight metadata for items matching query, and returns a list of files for further manipulation.

Options

-0

Displays each entry followed by a null character instead of a linefeed. This is usually used for feeding into xargs -0.

-live

After displaying the list of files, displays a count of files matching the query. The count is updated each time the count is updated. Use Control-C to cancel.

-onlyin dir

Limit the directories searched to dir.

Common attributes

The following are attributes commonly set by the metadata indexer. These attributes are also used by the mdls command. You can use mdimport -A to list all attributes supported by indexers in your system.

kMDItemAttributeChangeDate

The date and time that a metadata attribute was last changed.

kMDItemAudiences

The intended audience of the file.

kMDItemAuthors

The authors of the document.

kMDItemCity

The document's city of origin.

kMDItemComment

Comments regarding the document.

kMDItemContactKeywords

A list of contacts associated with the document.

kMDItemContentCreationDate

The document's creation date.

kMDItemContentModificationDate

Last modification date of the document.

kMDItemContentType

The qualified content type of the document, such as com.adobe.pdf for PDF files and com.apple.protected-mpeg-4-audio for an Apple Advanced Audio Coding (AAC) files.

kMDItemContributors

Contributors to this document.

kMDItemCopyright

The copyright owner.

kMDItemCountry ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required