I am a new to mac osx. One thing confusing me is what does /Library
or /System/Library
folders store? As its name meaning, I thought is should be something like /lib
or /usr/lib
in Linux. However, it does not. Inside it, it looks more similar to application bundles. And all naming is very application-specific, like /Library/iChat
. If they are application-specific, then why they are called Library
? Usually when named as Library
, it is for codes or resources sharing purpose.
The library folders store settings, resources, and support files. There are up to 6 "levels" of them:
~/Library
, stores per-user settings, etc./Library
, stores computer-wide settings, etc. By the way, I call this the "local" library, because in NextStep it was /Local/Library
, but you'll see all sorts of other names for it, such as the root library, computer library, .../Network/Library
, would store settings shared by all computers in a network domain -- if a network domain admin set one up, which nobody does anymore/System/Library
, stores the base settings, resources, etc that come with OS X. In theory, you shouldn't change anything in here.Sandboxed apps don't have access to most of the user's home folder. They're mostly restricted to their own sandbox "container" (which is itself inside the user library), and as a result, they get their own "private" libraries:
~/Library/Containers/<application-ID>/Data/Library
, which will generally contain a few real folders like Preferences and Saved Application State, and also symbolic links to the regular-user-library versions of other folders (e.g., Fonts).~/Library/Group Containers/<application-group-ID>/Library
, are used to store shared preferences, application support files, caches, etc between related groups of applications (from the same developer).Now, as for the files inside the various library folders: Most of them are organized by type (e.g., there's a Preferences
folder, a Caches
folder, an Application Support
folder, etc) with files/subfolders per application (or system component, or whatever). Some resource types are available to many or all programs (e.g., Fonts, Keychains, Services), so there's just a bunch of files there. However, some programs (mostly Apple-authored ones) are, um, egotistical enough to think they need their own top-level folder inside the library, so they go ahead and create one and store things in it.
As for the name "Library", I wouldn't read too much into it. It's basically a place to store things that programs need to get at, but that the user doesn't (generally) need to be explicitly aware of. Basically, things that the user never needs to double-click or use an open/save dialog to access. When you run Mail.app, you don't need to tell it to use the settings in ~/Library/Preferences/com.apple.mail.plist
, or the cached mailbox contents in ~/Library/Mail
, or the state information in ~/Library/Saved Application State/com.apple.mail.savedState
.