||The topic of this article may not meet Wikipedia's general notability guideline. (December 2016) (Learn how and when to remove this template message)|
|This article relies too much on references to primary sources. (December 2016) (Learn how and when to remove this template message)|
defaults is a command line utility that manipulates plist files. defaults is present in the OS X and GNUstep operating systems, and it first appeared in the NeXTStep operating system upon which both of the aforementioned systems are based. The system stores each user's preferences set in a .plist file for each program stored at ~/Library/Preferences for user-specific preferences, and /Library/Preferences/ for global preferences. Either way, the defaults utility writes or reads from these plist files depending on the one given.[clarification needed]
The most common uses of defaults is:
$ 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, without the extension '.plist'. plist files are named with Java-style reverse domain name notation. For example:
$ defaults read com.apple.iTunes # prints all of iTunes' preference values
$ defaults write com.apple.Safari AddressBarIncludesGoogle 0
$ defaults write com.apple.Safari AddressBarIncludesGoogle -boolean FALSE # case-sensitive!
Replacing 0 with 1 or FALSE with TRUE returns the search bar to normal.
Sometimes, preferences cause corrupt applications. To reset Address Book's preferences, you would either remove the ~/Library/Preferences/com.apple.AddressBook.plist file or issue the command
$ defaults delete com.apple.AddressBook
Some example settings configurable with defaults.
|Domain||Value||OSX Version||Legal Values||Default Values|
|NSGlobalDomain||AppleHighlightColor||10.8||3 floats range 0-1.0||"0.780400 0.815700 0.858800"|
|NSGlobalDomain||AppleShowScrollBars||10.8||Automatic, WhenScrolling, Always||Automatic|
|NSGlobalDomain||NSWindowResizeTime||10.8||float:time in seconds||.2|
- defaults manual page, Apple Inc
|This Apple-related article is a stub. You can help Wikipedia by expanding it.|