Where Preferences Are Stored

As mentioned earlier, the defaults database stores preference data in files located in the Library/Preferences folder of a filesystem domain. For example, when a preference applies to a single user, it is written to the ~/Library/Preferences folder. If the preference applies to all users on a system, it is written to the /Library/Preferences folder.

Each of the files in the defaults database takes a unique name, known as a preference domain, determined by the application that uses it. The Apple-recommended naming convention for preference domains is to use the reverse Internet domain name of an application’s vendor, followed by the name of the application. For example, all the plist files used by the various Apple-supplied applications use filenames that begin with com.apple, followed by the name of the application, followed by the .plist extension. Example 14-2 shows a partial command-line listing of the ~/Library/Preferences directory for a freshly created user:

Example 14-2. The ~/Library/Preferences directory

$ ls -l total 296 drwx------ 3 panic panic 102 Jun 9 20:52 ByHost drwx------ 3 panic panic 102 May 16 16:27 Explorer drwxr-xr-x 3 panic panic 102 Jun 9 20:53 Macromedia -rw-r—r-- 1 panic panic 8611 Jun 9 20:52 QuickTime Preferences -rw------- 1 panic panic 234 Jun 9 21:04 com.apple.AddressBook.plist -rw------- 1 panic panic 443 May 16 16:38 com.apple.BezelServices.plist -rw------- 1 panic panic 483 Jun 9 20:52 com.apple.Bluetooth.plist -rw------- ...

Get Running Mac OS X Tiger now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.