Name

defaults

Synopsis

    defaults [options] command [arguments]

Access or update the application defaults database. Most Mac OS X applications maintain a set of application defaults in a per-user database. The database provides storage for these defaults for when the application is not running. The defaults command provides access to this database from the Unix shell. Besides the per-user database, there is also a system-wide, global database of default values.

Applications are specified either by name with the -app option, or via a Java-style domain name, such as com.apple.TextEdit. Defaults are stored as key/value pairs. Keys are always strings, but values may be complicated structures such as arrays and dictionaries, or strings or binary data. They are stored as XML property lists.

Tip

It is inadvisable to change the defaults for an application that is running. The application will not see the change, and could potentially overwrite the new values when it exits.

Options

-app appname

Access the defaults for application appname.

-array

The value for a preference key is an array. The array values are given as separate arguments in a list. The new value overwrites any previous value for the key.

-array-add

Like -array, but the new elements are appended to an existing array of values.

-bool[ean]

The value for a preference key is a boolean. The value must be one of TRUE, FALSE, YES, or NO.

-currentHost

Preference operations may be performed only on the current host.

-data

The value for a preference ...

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.