Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

defaults (software)

From Wikipedia, the free encyclopedia
Not to be confused with the generic computer science concept ofdefaults.
Command-line utility
The topic of this articlemay not meet Wikipedia'sgeneral notability guideline. Please help to demonstrate the notability of the topic by citingreliable secondary sources that areindependent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to bemerged,redirected, ordeleted.
Find sources: "Defaults" software – news ·newspapers ·books ·scholar ·JSTOR
(December 2016) (Learn how and when to remove this message)
icon
This articlerelies excessively onreferences toprimary sources. Please improve this article by addingsecondary or tertiary sources.
Find sources: "Defaults" software – news ·newspapers ·books ·scholar ·JSTOR
(December 2016) (Learn how and when to remove this message)


defaults is acommand line utility that manipulatesplist files. Introduced in 1998OPENSTEP,defaults is found in the system's descendantsmacOS andGNUstep.[1][2]

The name "defaults" derives from OpenStep's name foruser preferences,Defaults, orNSUserDefaults inFoundation 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 aNSGlobalDomain.plist, where defaults written there will be seen by all applications.[2][3] InmacOS, theDefaults part of the path is replaced by the more intuitiveLibrary/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

[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 name sans extension ('.plist'). plist files are named withreverse 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 fromSafari'saddress 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

[edit]

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

[edit]

Some example settings configurable with defaults under macOS:

Globally-available defaults (works inNSGlobalDomain 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 usingdefaults.[12] Apple does not publish a complete list of these "secret knobs", but their support site does occasionally providedefaults 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]

References

[edit]
  1. ^abdefaults(1) – Linux General CommandsManual from ManKier.com
  2. ^abcddefaults(1) – Darwin andmacOS General CommandsManual
  3. ^ab"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. ^ab"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. Retrieved1 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. Retrieved5 January 2020. (type into a search engine to find more: site:support.apple.com "defaults write")

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Defaults_(software)&oldid=1336965861"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp