Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does mac os /Library folder store?

Tags:

macos

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.

like image 457
Alfred Avatar asked Jan 11 '13 21:01

Alfred


People also ask

What is stored in Mac Library folder?

Library. This folder contains fonts and other items used by apps that are available to all users of your Mac. Don't use this folder to store files and folders you create. Instead, use the home folder, the Desktop folder, the Documents folder, or iCloud Drive.

Can I delete Library folder in Mac?

To view your user library folder, click Users > Your Name. Click on the Library folder where you will find the largest folder. Keep clicking the largest folder and you'll notice the largest files in it. To delete a folder or a file, check the box next to it, and click the Remove button.

Should I Backup Mac Library folder?

The structure of the system level /Library folder closely matches that of the ~/Library folder, so if there are things in there (fonts, color profiles, scripts etc.) installed "for all users", you should back those up too.

Why does Mac have two libraries?

Why does macOS need two Library folders? The System library is used by all users for system-wide needs. It's accessible to all users. The user Library, on the other hand, is accessible only by that particular user.


1 Answers

The library folders store settings, resources, and support files. There up to 6 "levels" of them:

  • The user library, ~/Library, stores per-user settings etc.
  • The local library, /Library, stores computer-wide settings etc. BTW, 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, ...
  • The network 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
  • The system library, /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:

  • Per-application sandbox 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).
  • Application group sandbox libraries, ~/Library/Group Containers/<application-group-ID>/Library, is 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.

like image 76
Gordon Davisson Avatar answered Sep 30 '22 18:09

Gordon Davisson