| MDSCHEMA(1) | General Commands Manual | MDSCHEMA(1) |
mdschema —
compile, query, and display information about a Spotlight
metadata attribute schema
mdschema |
[-h] [-a]
[-A attribute]
[-t type]
[-compile path]
[-path path] |
The mdschema utility is used to compile,
query, and display information about a Spotlight metadata attribute schema.
Spotlight uses a schema to define metadata attributes that can be associated
with files and other searchable content. This tool allows compilation of a
custom schema, along with inspection of the schema, including attribute
definitions, display names, and content type associations.
The following options are available:
-h-a-A
attributekMDItemDisplayName’ or
‘com_apple_metadata_modtime’.-t
typepublic.jpeg’ or
‘com.apple.mail.email’.-compile
path-path
pathDisplay all available metadata attributes:
mdschema -aGet information about a specific attribute:
mdschema -A
kMDItemDisplayNameShow attributes for JPEG images:
mdschema -t public.jpegCompile and build a metadata schema cache:
mdschema -compile /path/to/schema.xml
-path /path/to/schema.mdplist| January 13, 2026 | macOS 26 |