DEFAULTS(1)

NAME
defaults - access the Mac OS X user defaults system

SYNOPSIS
defaults [currentHost | -host hostname] read [ domain [key]]

defaults [currentHost | -host hostname] read-type domain key

defaults [currentHost | -host hostname] write domain { 'plist' | domain key 'value' }

defaults [currentHost | -host hostname] rename domain old_key new_key

defaults [currentHost | -host hostname] delete [ domain [key]]

defaults [currentHost | -host hostname] { domains | find word | help }

DESCRIPTION
Defaults allows users to read, write, and delete Mac OS X user defaults from a command-line shell. Mac OS X applications and other programs use the defaults system to record user preferences and other information that must be maintained when the applications aren't running (such as default font for new documents, or the position of an Info panel). Much of this information is accessible through an application's Preferences panel, but some of it isn't, such as the position of the Info panel. You can access this information with defaults

Note: Since applications do access the defaults system while they're running, you shouldn't modify the defaults of a running application. If you change a default in a domain that belongs to a running application, the application won't see the change and might even overwrite the default.

User defaults belong to domains, which typically correspond to individual applications. Each domain has a dictionary of keys and values representing its defaults; for example, "Default Font" = "Helvetica". Keys are always strings, but values can be complex data structures comprising arrays, dictionaries, strings, and binary data. These data structures are stored as XML Property Lists.

Though all applications, system services, and other programs have their own domains, they also share a domain named NSGlobalDomain. If a default isn't specified in the application's domain, but is specified in NSGlobalDomain, then the application uses the value in that domain.

The options are as follows:

read
    Prints all of the user's defaults, for every domain, to standard output.

read domain
    Prints all of the user's defaults for domain to standard output.

read domain key
    Prints the value for the default of domain identified by key.

write domain key 'value'
    Writes value as the value for key in domain. value must be a property list, and must be enclosed in single quotes. For example:

        defaults write com.companyname.appname "Default Color" '(255, 0, 0)'

    sets the value for Default Color to an array containing the strings 255, 0, 0 (the red, green, and blue components). Note that the key is enclosed in quotation marks because it contains a space.

write domain 'plist'
    Overwrites the defaults information in domain with that given as plist. plist must be a property list representation of a dictionary, and must be enclosed in single quotes. For example:

        defaults write com.companyname.appname '{ "Default Color" = (255, 0, 0);
        				"Default Font" = Helvetica; }';

    erases any previous defaults for com.companyname.appname and writes the values for the two names into the defaults system.

delete domain
    Removes all default information for domain.

delete domain key
    Removes the default named key from domain.

domains
    Prints the names of all domains in the user's defaults system.

find word
    Searches for word in the domain names, keys, and values of the user's defaults, and prints out a list of matches.

help
    Prints a list of possible command formats.

BUGS
Defaults can be structured in very complex ways, making it difficult for the user to enter them with this command.

HISTORY
First appeared in NeXTStep.