defaults is a command line utility in macOS that manipulates plist files.

Usage Edit

Common uses of defaults:

$ defaults read DOMAIN # gets all
$ defaults read DOMAIN PROPERTY_NAME # gets
$ defaults write DOMAIN PROPERTY_NAME $VALUE # sets
$ defaults delete DOMAIN PROPERTY_NAME # resets a property
$ defaults delete DOMAIN # resets preferences

DOMAIN should be replaced by the plist file sans extension ('.plist'). plist files are named with reverse domain name notation. For example:

$ defaults read # prints all iTunes preference values
$ defaults read # prints all Chrome values

The PROPERTY_NAME key is the name of the property to modify. For example, to remove the search field from Safari's address bar:

$ defaults write AddressBarIncludesGoogle 0


$ defaults write AddressBarIncludesGoogle -bool NO # case-sensitive!

Replacing 0 with 1 or NO with YES or FALSE with TRUE returns the search bar to normal.

Preferences can at times corrupt applications. To reset Address Book's preferences, you would either remove the file ~/Library/Preferences/ or issue the command:

$ defaults delete