What Is ~/Library/Preferences/ByHost on Mac?
Your user folderUpdated
- Full path
~/Library/Preferences/ByHost
- Scope
- Your user folderInside your home folder — one copy per user account.
- Freshist & this folder
- Freshist checks this folder when uninstalling an app. When you uninstall an app, Freshist looks here for items that belong to it. Matches on the app's bundle ID can be pre-selected; name-only guesses are labeled “not sure” and never pre-selected. Removed items go to the Trash, so you can undo.
From Freshist's own cleaning rules — the same catalog the app uses.
What "by host" means
Most preferences follow your account: copy your home folder to another Mac and your settings come along. Some settings only make sense on one machine, though. Display arrangement, screen saver choice, menu bar items, Bluetooth and some input settings depend on the hardware in front of you. macOS writes those current-host preferences into ~/Library/Preferences/ByHost, and adds the Mac's hardware UUID to each file name:
com.apple.screensaver.A1B2C3D4-0000-1111-2222-333344445555.plist
When an app reads a current-host setting, macOS looks only for the file with this Mac's UUID. Files carrying any other UUID are invisible to it.
Where leftovers come from
| Kind of file | Why it's there | Safe to remove? |
|---|---|---|
Current UUID, com.apple.* | Live per-Mac system settings | Leave it |
| Current UUID, app you still use | Live per-Mac app settings | Leave it |
| Current UUID, app you removed | Left by the app (ShipIt files are typical) | Yes |
| Different UUID | Copied over from an older Mac or a logic board replacement | Yes, macOS ignores it |
Migration Assistant copies your whole home folder, so a Mac set up from an older one often has two or more sets of ByHost files. The old set never gets cleaned up, because nothing on the new machine reads it. The files are small, usually a few hundred kilobytes in total, so this is tidiness rather than a storage problem.
Find your Mac's UUID and compare
Choose Apple menu → System Settings → General → About → System Report and look for Hardware UUID under Hardware Overview. Or in Terminal:
ioreg -rd1 -c IOPlatformExpertDevice | grep IOPlatformUUID
ls ~/Library/Preferences/ByHost
du -sh ~/Library/Preferences/ByHost
Any file whose name ends in a different UUID came from another machine. To read one of your current-host domains through the preferences system instead of opening files, use the -currentHost flag:
defaults -currentHost read com.apple.screensaver
Removing leftovers
- Note your current Hardware UUID.
- In Finder, choose Go → Go to Folder… and enter
~/Library/Preferences/ByHost. - Move files that end with a different UUID to the Trash. For apps you've uninstalled, also move files starting with that app's bundle ID.
- Keep the Trash for a day or two, then empty it.
To reset a single current-host setting for an app you still use, quit the app and run defaults -currentHost delete <bundle ID>. That goes through the preferences daemon, which avoids the app writing a cached copy back.
Related folders
ByHost is a subfolder of ~/Library/Preferences, which holds the account-wide settings. When you remove an app completely, its larger leftovers are usually in Application Support and Caches. The post on uninstalling apps completely lists every place to check.
Sources
- About preferences and settings (Apple Preferences and Settings Programming Guide)
- Transfer to a new Mac with Migration Assistant (Apple Support)
man defaultsin Terminal (see-currentHost)
Frequently asked questions
Is the long number in ByHost file names my serial number?
No. It's the hardware UUID macOS assigns to the Mac, shown as Hardware UUID in System Information. It isn't your serial number, though it does identify the machine, so avoid posting full file listings publicly.
Why are there ShipIt files in ByHost?
Apps built on Electron often use an updater framework called Squirrel, whose ShipIt component writes a small per-host file here. It stays after the app is removed and is one of the more common leftovers.
Can I just empty the whole ByHost folder?
Not a good idea. Files with your current Mac's UUID include system settings such as screen saver, Control Center and some input preferences, which would reset to defaults.