Defaults (software)

Last updated

defaults is a command line utility that manipulates plist files. Introduced in 1998 OPENSTEP, defaults is found in the system's descendants macOS and GNUstep. [1] [2]

Contents

The name "defaults" derives from OpenStep's name for user preferences, Defaults, or NSUserDefaults in Foundation Kit. Each application had its own defaults plist ("domain"), under ~/Defaults for the user configuration and /Defaults for the system configuration. The lookup system also supports a NSGlobalDomain.plist, where defaults written there will be seen by all applications. [2] [3] In macOS, the Defaults part of the path is replaced by the more intuitive Library/Preferences. defaults accesses the plists based on the domain given. [2]

defaults is also able to read and write any plist specified with a path, [1] although Apple plans to phase out this utility in a future version. [2] [4]

Usage

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 name sans extension ('.plist'). plist files are named with reverse domain name notation. For example:

$ defaults read com.apple.iTunes # prints all iTunes preference values

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:

$ defaults write com.apple.Safari AddressBarIncludesGoogle 0 $ # or $ defaults write com.apple.Safari AddressBarIncludesGoogle -bool NO # case-sensitive!

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 delete com.apple.AddressBook

Compound values

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. [5]

Settings

Some example settings configurable with defaults under macOS:

Globally-available defaults (works in NSGlobalDomain or application settings)
KeyOSX VersionLegal ValuesDefault Value
AppleAquaColorVariant10.81, 61
AppleHighlightColor10.8RGB, 3 floats range 0-1.0"0.780400 0.815700 0.858800"
AppleShowScrollBars [6] 10.8Automatic, WhenScrolling, AlwaysAutomatic
NSQuitAlwaysKeepsWindows [7] 10.8boolfalse
NSAutomaticWindowAnimationsEnabled [8] 10.8booltrue
NSNavPanelExpandedStateForSaveMode [9] 10.8boolfalse
NSWindowResizeTime [8] 10.8float:time in seconds.2
CGFontDefaultAllowsFontSmoothing [10] 10.14?boolean

SS64 documents a set of other keys that can be changed for each software (not the global domain) in macOS. [11] Other sites also document settings to be changed using defaults. [12] 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. [13]

GNUstep documents its defaults more clearly, so that there is no such thing as a "hidden settings" community like there is for macOS. [3]

Related Research Articles

Default may refer to:

<span class="mw-page-title-main">GNUstep</span> Open source widget toolkit and application development tools

GNUstep is a free software implementation of the Cocoa Objective-C frameworks, widget toolkit, and application development tools for Unix-like operating systems and Microsoft Windows. It is part of the GNU Project.

<span class="mw-page-title-main">Configuration file</span> Software file used to configure the initial settings for a computer program

In computing, configuration files are files used to configure the parameters and initial settings for some computer programs. They are used for user applications, server processes and operating system settings.

<span class="mw-page-title-main">Aqua (user interface)</span> User interface of macOS by Apple

Aqua is the graphical user interface, design language and visual theme of Apple's macOS operating system. It was originally based on the theme of water, with droplet-like components and a liberal use of reflection effects and translucency. Its goal is to "incorporate color, depth, translucence, and complex textures into a visually appealing interface" in macOS applications. At its introduction, Steve Jobs noted that "... it's liquid, one of the design goals was when you saw it you wanted to lick it".

Mach-O, short for Mach object file format, is a file format for executables, object code, shared libraries, dynamically-loaded code, and core dumps. It was developed to replace the a.out format.

<span class="mw-page-title-main">Spotlight (Apple)</span>

Spotlight is a system-wide desktop search feature of Apple's macOS and iOS operating systems. Spotlight is a selection-based search system, which creates an index of all items and files on the system. It is designed to allow the user to quickly locate a wide variety of items on the computer, including documents, pictures, music, applications, and System Settings. In addition, specific words in documents and in web pages in a web browser's history or bookmarks can be searched. It also allows the user to narrow down searches with creation dates, modification dates, sizes, types and other attributes. Spotlight also offers quick access to definitions from the built-in New Oxford American Dictionary and to calculator functionality. There are also command-line tools to perform functions such as Spotlight searches.

<span class="mw-page-title-main">Windows Registry</span> Database for Microsoft Windows

The Windows Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the registry. The kernel, device drivers, services, Security Accounts Manager, and user interfaces can all use the registry. The registry also allows access to counters for profiling system performance.

<span class="mw-page-title-main">Dashboard (macOS)</span> Discontinued feature of macOS

Dashboard is a discontinued feature of Apple Inc.'s macOS operating systems, used as a secondary desktop for hosting mini-applications known as widgets. These are intended to be simple applications that do not take time to launch. Dashboard applications supplied with macOS included a stock ticker, weather report, calculator, and notepad; while users could create or download their own.

Most file systems include attributes of files and directories that control the ability of users to read, change, navigate, and execute the contents of the file system. In some cases, menu options or functions may be made visible or hidden depending on a user's permission level; this kind of user interface is referred to as permission-driven.

<span class="mw-page-title-main">Option key</span> Modifier key present on Apple keyboards

The Option key, , is a modifier key present on Apple keyboards. It is located between the Control key and the Command key on a typical Mac keyboard. There are two Option keys on modern Mac desktop and notebook keyboards, one on each side of the space bar.

launchd is an init and operating system service management daemon created by Apple Inc. as part of macOS to replace its BSD-style init and SystemStarter. There have been efforts to port launchd to FreeBSD and derived systems.

A menu bar is a graphical control element which contains drop-down menus.

In the macOS, iOS, NeXTSTEP, and GNUstep programming frameworks, property list files are files that store serialized objects. Property list files use the filename extension .plist, and thus are often referred to as p-list files.

In NeXTSTEP, OPENSTEP, GNUstep, and their lineal descendants macOS and iOS, a bundle is a file directory with a defined structure and file extension, allowing related files to be grouped together as a conceptually single item.

The Apple Developer Tools are a suite of software tools from Apple to aid in making software dynamic titles for the macOS and iOS platforms. The developer tools were formerly included on macOS install media, but are now exclusively distributed over the Internet. As of macOS 10.12, Xcode is available as a free download from the Mac App Store.

A local shared object (LSO), commonly called a Flash cookie, is a piece of data that websites that use Adobe Flash may store on a user's computer. Local shared objects have been used by all versions of Flash Player since version 6.

On Apple computers, pmset is a command line utility to manipulate power management settings under the Darwin and macOS operating systems. It can assign sleep settings, schedule sleep and wake times, and display power information.

macOS Sierra Thirteenth major release of macOS

macOS Sierra is the thirteenth major release of macOS, Apple Inc.'s desktop and server operating system for Macintosh computers. The name "macOS" stems from the intention to uniform the operating system's name with that of iOS, watchOS and tvOS. Sierra is named after the Sierra Nevada mountain range in California and Nevada. Its major new features concern Continuity, iCloud, and windowing, as well as support for Apple Pay and Siri.

macOS Ventura 19th major version of the macOS operating system

macOS Ventura is the nineteenth and current major release of macOS, Apple's desktop operating system for Mac computers. The successor to macOS Monterey, it was announced at WWDC 2022 on June 6, 2022, and launched on October 24, 2022. It is named after the city of Ventura and is the tenth macOS release to bear a name from the company's home state of California. The macOS 13 Ventura logo and default wallpaper resemble an abstract California poppy.

References

  1. 1 2 defaults(1)    Linux General Commands Manual
  2. 1 2 3 4 defaults(1)    Darwin and macOS General Commands Manual
  3. 1 2 "User Defaults Summary for GNUstep Libraries". www.gnustep.org.
  4. "Unofficial macOS defaults man page". ss64.com.
  5. "macos - modifying a Plist from command line on Mac using Defaults". Stack Overflow.
  6. grg (26 August 2013). "macos - Enabling Scroll Bars In Mountain Lion?". Ask Different.
  7. "Disable 'Resume' system-wide". defaults-write.com. 26 September 2012.
  8. 1 2 "10 terminal commands to speed up macOS High Sierra on your Mac". defaults-write.com. 11 November 2017.
  9. Bynens, Mathias. "mathiasbynens/dotfiles: .macos". GitHub. Retrieved 1 March 2020.
  10. "Issue 858861: No subpixel antialiasing under macOS Mojave". bugs.chromium.org.
  11. "System preference settings for macOS - macOS - SS64.com". ss64.com.
  12. "Top 11 Terminal Command Tricks for Mac That You Should Know". Guiding Tech. 19 August 2019.
  13. "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")