defaults (software)

defaults (software)

defaults is a command line utility that manipulates plist files. defaults is present in the Mac 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.

Usage

The most common uses of defaults is:

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

$PLIST_FILE is replaced by the plist file, without the extension. plist files are named similar to Java packages: you take the software developer's domain name, reverse it, place a dot (.), and then the application's name followed by .plist. So for example, iTunes' plist file would be com.apple.iTunes.plist. When you pass the value to defaults, you remove the .plist:

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

plist files store property lists and values. The $PROPERTY_NAME value becomes 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 -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 ~/Library/Preferences/com.apple.AddressBook or issue the command

$ defaults delete com.apple.AddressBook

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Defaults (software) — defaults is a command line utility that manipulates plist files. defaults is present in the Mac OS X and GNUstep operating systems, and it first appeared in the NeXTStep operating system upon which both of the aforementioned systems are based.… …   Wikipedia

  • Software license agreement — EULA redirects here. For the community, see Eula, Texas. A software license agreement is a contract between the licensor and purchaser of the right to use software. The license may define ways under which the copy can be used, in addition to the… …   Wikipedia

  • Mono (software) — This article is about the computing platform. For other uses, see Mono (disambiguation). Mono Developer(s) Xamarin (formerly by Novell and originally by Ximian) and the Mono community …   Wikipedia

  • Comparison of revision control software — The following is a comparison of revision control software. The following tables includes general and technical information for notable revision control and software configuration management (SCM) software. This is an incomplete list, which may… …   Wikipedia

  • Blender (software) — Infobox Software name = Blender caption = Blender 2.47 developer = The Blender Foundation latest release version = 2.47 latest release date = release date and age|2008|08|23 latest preview version = 2.48 RC1 latest preview date = release date and …   Wikipedia

  • Automatically Tuned Linear Algebra Software — (ATLAS) is a software library for linear algebra. It provides a mature open source implementation of BLAS APIs for C and Fortran77.ATLAS is often recommended as a way to automatically generate an optimized BLAS library. While its performance… …   Wikipedia

  • Dashboard (software) — Infobox Software name = Dashboard logo = caption = Dashboard widgets running under Mac OS X v10.5 Leopard (including one made with Safari 3 s Web Clip feature). latest release version = 2.0 latest release date = October 26, 2007 developer = Apple …   Wikipedia

  • Default — may refer to: Default (law), the failure to do something required by law Default judgment Default (finance), failure to satisfy the terms of a loan obligation or to pay back a loan Default (computer science), a preset setting or value Default… …   Wikipedia

  • Features new to Windows Vista — This article is part of a series on Windows Vista New features Overview Technical and core system Security and safety Networking technologies I/O technologies Management and administration Removed features …   Wikipedia

  • Default (computer science) — A default, in computer science, refers to a setting or value automatically assigned to a software application, computer program or device, outside of user intervention. Such settings are also called presets, especially for electronic devices. The …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”