Understanding Your Mac’s System Folders

System folders are folders not intended to be accessed by the user. They help applications and the operating system run, providing support and resources. They’re the layer that allows users to manipulate the host through applications and programs. Some are hidden, and some are not, but almost all are accessible to the user in some way.

But what are the different system folders for? What’s “bin,” and how does it help your computer? We will examine the most commonly-referenced system folders below.

The “/System” folder itself on your Mac doesn’t contain much. We will first look at its contents before moving on to other, deeper system folders.

Note: Do not add to, remove, or modify system folders and files. You can browse safely, but adding, removing, or modifying files or changing the folders themselves can have unpredictable – and sometimes system-breaking – consequences. If you must experiment, make a bootable clone of your Mac before proceeding.

mac-system-folders-extensions-both-library

Library folders are closest to the user. They are created by applications, and applications add, remove, and modify files over the course of their operation. To be frank, the organizational process here can be a little chaotic. Applications are basically free to do what they like when it comes to placing files in the Library, but most follow a fairly similar process.

You’ll find a huge variety of files and folders in both the user Library folder (found at “~/Library”) and the system Library folder (found at “/System/Library”). These files save preferences, application databases, metadata, plugins, saved application states, system profiles, cookies, and much, much more.

Application Support

mac-system-folders-library-application-support-folder

The “~/Library/Application Support” folder is the most frequently accessed Library folder. Here, applications save files needed for their operations. Away from the user’s data folders, these files can be segregated to avoid contamination or modification.

When users access this folder, it’s to change the way a program works in a way that is unsupported by the default settings or to fix some kind of cache or database error. Removing a program’s Application Support folder is a good way to reset the program to its default state and force a clean start. And if you want to hack around in an application, you’ll find yourself in that program’s Application Support folder before too long.

What’s the difference between /System/Library and ~/Library?

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.

mac-system-folders-unix-folders

macOS is built on top of a Unix kernel. This means that much of its deep functionality is based on Unix functionality. So apart from the higher-level macOS system folders, you’ll find Unix folders as well. These folders are universally hidden, so you’ll need to reveal hidden files to follow the tour.

You’ll find quite a few Unix folders in your home directory. The most notable are “/bin” and “/sbin,” “/usr,” “/var,” and “/private.”

mac-system-folders-bin-sbin-folders

“/bin” and “/sbin” both hold binaries. “sbin” holds binaries needed for booting, restoring, recovering, and repairing the system even without a file system mounted. “/bin” holds essentially user commands for use by all users. “bin” stands for binaries and “sbin” stands for system binaries.

On macOS most of the filesystem-mounting binaries in “/sbin” are symlinked to macOS file system plugins in the “/System/Library/Filesystems” folder.

mac-system-folders-usr-folder

“/usr” contains binaries and libraries used during normal system operation. Files here are used after a file system is mounted. “usr” is short for “user” or Unix System Resources.

mac-system-folders-var-folder

“/var” contains files the system writes to over the course of its operation, like caches, data libraries, and logs. Var stands for variable and is typically only written to by core-level system applications. On macOS “/var” is symlinked to “/private/var.”

mac-system-folders-private-folder

“/private” contains daemon and command line tool configurations, caches, variables, virtual memory swap files, temporary files, and sleep images. Some Unix system folders like “/etc” and “/tmp” are symlinked to an identically-named directory in /private for their contents.

If you want to learn about the contents of these folders, you can check out this detailed breakdown of the Mac’s Unix folders.

mac-system-folders-extensions-kexts

If you’ve ever built a Hackintosh, you’ve heard of “System/Library/Extensions.” Commonly abbreviated “S/L/E,” this folder contains “kexts,” or kernel extensions, that expand the functionality of the macOS kernel. Adding kexts helps the macOS kernel communicate with new hardware. If you’re from Windows-land, kexts are like drivers.

Modifying the contents of this folder is tricky business, requiring careful permissions management. If you want to add or remove kexts on macOS, make sure you do it right.

Daemons and agents run in the background, performing tasks without interaction from the user. The unusual name (pronounced as “demon”) originates with Maxwell’s daemon.

Daemons perform system operations and are run by root, while agents are run by the currently logged-in user. Global agents and daemons can be accessed and run on behalf of any user, while user agents can only be run on behalf of the user that owns their library file.

  • “~/Library/LaunchAgents” contains user agents run on behalf of the logged in user
  • “/Library/LaunchAgents” contains global agents run on behalf of the logged in user
  • “/System/Library/LaunchAgents” contains system agents run on behalf of the logged in user
  • “/Library/LaunchDaemons” contains global daemons run by root
  • “/System/Library/LaunchDaemons” contains system daemons run by root

You can create new daemons and configure existing ones with the command line program launchctl.

There are other non-user folders hidden away on your Mac, but those above are the most commonly accessed. You can learn more about how Unix file systems are organized by checking out the Filesystem Hierarchy Standard, which explains the requirements and guidelines for Unix-like file and directory placement.

2 comments

  1. In the part of the article about Mac Libraries, you seem to be saying there are only two of them. But my Mac has _three_ “Library” folders: the two you described (in /System/ and in my user hierarchy), and also a third, at the root level of my boot volume. They tend to have some subfolders that share the same names, but not always — for example, my /System/Library/ does _not_ have an “Application Support” subfolder, but the other two Libraries do.

    Perhaps you could expand the article to explain more about why there are THREE “Library” folders — what’s the logic of that? — and also which items in them users are most likely to want to hack at. Thanks.

    • You’re right, I didn’t directly mention the /Library folder! Totally my own oversight.

      Three libraries might seem like a lot, but there is a logic to it. Files in /System/Library support macOS system applications. Files in /Library support applications accessible by all users. Files in ~/Library support applications installed by that user. You will sometimes see duplication between /Library and ~/Library, which allows an app to be accessible to all users while also saving preferences for an individual user.

      Unless you want to make modifications to how macOS runs (as you might do on a Hackintosh), you won’t find much of interested in /System/Library. You won’t find an Application Support folder there because it’s not accessible by user-installed apps, and macOS uses a slightly different support structure for core applications.

      The areas of most interest are generally in ~/Library, followed by /Library.

Leave a Comment

Yeah! You've decided to leave a comment. That's fantastic! Check out our comment policy here. Let's have a personal and meaningful conversation.

Sponsored Stories