mdfind(1) BSD General Commands Manual mdfind(1)
NAME
mdfind -- finds files matching a given query
SYNOPSIS
mdfind [-live] [-onlyin directory] query
DESCRIPTION
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.
The following options are available:
-00 Prints an ASCI NUL character after each result path. This
is useful when used in conjunction with xargs -0.
-live Causes the mdfind command to provide live-updates to the num-
ber of files matching the query. When an update causes the
query results to change the number of matches is updated.
The find can be cancelled by typing ctrl-C.
-onlyin dir
Limit the scope of the search to the directory specified.
EXAMPLES
The following examples are shown as given to the shell.
This returns all files with any metadata attribute value matching the
string "image":
mdfind image
This returns all files that contain "MyFavoriteAuthor" in the kMDItemAu-
thor metadata attribute:
mdfind "kMDItemAuthor == '*MyFavoriteAuthor*'"
This returns all files with any metadata attribute value matching the
string "skateboard". The find continues to run after gathering the ini-
tial results, providing a count of the number of files that match the
query.
mdfind -live skateboard
SEE ALSO
mdcheckschema(1), mdimport(1), mdls(1), mdutil(1), xargs(1)
Mac OS X June 10, 2004 Mac OS X
|