About the OS X ByHost preferences directory

Most preferences in OS X are stored directly in the user's Preferences folder; however, within this folder is a directory called ByHost that contains other commonly used preferences.

Often when troubleshooting odd application or system behavior in OS X you will access the preferences folder in your user account to remove or manually edit settings for a program. While in most cases you will find the preferences file for an application directly in the Preferences folder, sometimes they will be in subfolders within the Preferences folder itself.

Usually this sequestering of preferences files is done by developers such as Microsoft or Adobe for their various applications or application suites; however, in addition to those from developers you will see a folder called ByHost that contains a number of preferences files for various system and application settings, such as for screensavers, the Dock, Bluetooth, iTunes, and Time Machine.

Unlike the files in the parent Preferences folder, those in the ByHost folder contain a long string of characters in their names, such as "com.apple.iTunes.E3D2E3A9-0C8C-5D8A-2E7B-92C263FA9F9C.plist" instead of "com.apple.iTunes.plist" as is seen in most preference file names.

System Profiler utility showing the hardware UUID
The preference files that are in use have the current Hardware UUID string in their names. Screenshot by Topher Kessler

This string of characters is a UUID (unique machine identifier) string that is unique for your computer, which you can look up by opening the System Profiler utility (called System Information in OS X Lion), selecting the Hardware section, and then finding next to "Hardware UUID." This naming scheme means that the files are specific for the machine that created them, which is used primarily for situations where the home folder is stored on a separate and portable storage location such as a network server, and is used with multiple machines.

When you log in to your account, the preference files for the specific machine you are working on will load from or be created in the ByHost folder, and these specific ones will not load when you use this same account to log in on another machine.

Even if you do not have your account configured to work with more than one machine, you may still see more than one preference file for a given application or system setting listed in the ByHost folder. Some of these might have a long UUID string, but others might have a smaller 12-character identifier string instead.

These files are likely the preferences from older versions of OS X, from when you migrated to your current system from an older one, or from if the system had a major hardware change during a repair. Older versions of OS X used the computer's MAC address (media access code--a unique identifier used in network cards) as the identifier string for the ByHost preference files, so if you migrated your system or upgraded from older versions of OS X over the years of using Mac systems, then it is likely that these are just left over from those older OS versions. On the other hand, duplicate preference files with different UUID strings will likely have been from hardware changes or migration to new Mac systems from relatively newer OS X versions.

The OS X ByHost folder
Older versions of OS X have used the MAC address as the identifier string for host-specific preference files. Modern versions of OS X use the UUID, which can be found in the System Profiler (System Information in Lion) utility. Screenshot by Topher Kessler

Regardless of how they originated, the only files that will be used on your current system are those that have the UUID identifier string that matches your current system, so while it will not hurt to have them around, you can remove the older files from the ByHost folder that do not match the Hardware UUID string listed in the ByHost preferences folder.

In addition to removing older unused versions of these files, do keep in mind that some system settings might use both a host-specific preferences file and a generic one in the main Preferences folder. For instances, the HIToolbox system process who's preference files shown in the screenshot above also has a standard "com.apple.HIToolbox.plist" preferences file in the main user Preferences folder. This process is responsible for holding the keyboard layout settings, so if some aspect of the keyboard layouts are not working on your system, then in addition to deleting or investigating the preferences file in the ByHost directory, you might also have to look at the one in the parent Preferences directory.

A final note about these preference files is that if you are familiar with using the "defaults" Terminal command to make modifications to preference files and wish to use it for targeting settings in these files, you can do so by using the "-currentHost" tag with the "defaults" command, in the following manner:

defaults -currentHost write com.apple.Bluetooth DiscoverableState -bool no

In this instance, the command will target the Bluetooth preferences file in the ByHost directory, and change its "DiscoverableState" key setting to be in an "off" state, as oppose to targeting any settings in the system or standard user preferences folder.



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

Tags:
Computers
About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    ARTICLE DISCUSSION

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    Hot on CNET

    CNET's giving away a 3D printer

    Enter for a chance to win* the MakerBot Replicator 3D Printer and all the supplies you need to get started.