Common uses of defaults:
DOMAIN should be replaced by the plist file name sans extension ('.plist'). plist files are named with reverse domain name notation. For example:
plist files store keys and 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:
Using "1", "YES", or "TRUE" instead restores this to the default of including search.
Preferences can at times corrupt applications. To reset Address Book's preferences, either the file ~/Library/Preferences/com.apple.AddressBook.plist must be removed or the following command issued:
defaults prints values in the OpenStep format. It allows the VALUE to be arrays and dicts, as long as they conform to old-style plist syntax.9
Some example settings configurable with defaults under macOS:
SS64 documents a set of other keys that can be changed for each software (not the global domain) in macOS.16 Other sites also document settings to be changed using defaults.17 Apple does not publish a complete list of these "secret knobs", but their support site does occasionally provide defaults commands for user to change a certain setting, such as the creation of .DS_Store.18
GNUstep documents its defaults more clearly, so that there is no such thing as a "hidden settings" community like there is for macOS.19
defaults(1) – Linux General Commands Manual https://www.mankier.com/1/defaults ↩
defaults(1) – Darwin and macOS General Commands Manual https://keith.github.io/xcode-man-pages/defaults.1.html ↩
"User Defaults Summary for GNUstep Libraries". www.gnustep.org. http://www.gnustep.org/resources/documentation/User/Gui/DefaultsSummary.html ↩
"Unofficial macOS defaults man page". ss64.com. https://ss64.com/osx/defaults.html ↩
"macos - modifying a Plist from command line on Mac using Defaults". Stack Overflow. https://stackoverflow.com/questions/13740337/modifying-a-plist-from-command-line-on-mac-using-defaults ↩
grg (26 August 2013). "macos - Enabling Scroll Bars In Mountain Lion?". Ask Different. https://apple.stackexchange.com/a/100062/153976 ↩
"Disable 'Resume' system-wide". defaults-write.com. 26 September 2012. https://www.defaults-write.com/disable-resume-system-wide/ ↩
"10 terminal commands to speed up macOS High Sierra on your Mac". defaults-write.com. 11 November 2017. https://www.defaults-write.com/speed-up-macos-high-sierra/ ↩
Bynens, Mathias. "mathiasbynens/dotfiles: .macos". GitHub. Retrieved 1 March 2020. https://github.com/mathiasbynens/dotfiles/blob/master/.macos ↩
"Issue 858861: No subpixel antialiasing under macOS Mojave". bugs.chromium.org. https://bugs.chromium.org/p/chromium/issues/detail?id=858861 ↩
"System preference settings for macOS - macOS - SS64.com". ss64.com. https://ss64.com/osx/syntax-defaults.html ↩
"Top 11 Terminal Command Tricks for Mac That You Should Know". Guiding Tech. 19 August 2019. https://www.guidingtech.com/top-terminal-command-tricks-mac-macos/ ↩
"Adjust SMB browsing behavior in macOS High Sierra 10.13 and later". Apple Support. Retrieved 5 January 2020. (type into a search engine to find more: site:support.apple.com "defaults write") https://support.apple.com/en-us/HT208209 ↩