Understanding the directory structure of macOS
Contrary to iOS, macOS allows both the user and software to access its file system. While this definitely has benefits and allows for more flexibility in the ways you interact with your data, it can also be the cause for severe software issues, if necessary files are modified, renamed or deleted.
So if you’re curious how the directory structure of macOS works, this guide is for you.
The three domains
macOS uses domains to divide the file system into parts used for different purposes. These are called: Local, System, and User domain. There’s also a fourth domain called Network, but as we are only looking at the structure of a typical installation, this may be ignored.
The Local domain consists of data that’s being used locally and by multiple users. The best example for this are probably applications. Usually the contents of this domain are controlled by the system, but if you’re logged in as a user with administrator privileges, you are allowed to modify its files and directories.
The System domain is essentially everything the Mac needs to run macOS. Files and directories in this domain should never be modified.
The User domain includes all files and directories of all users present on a macOS installation. Typically, a user will only be able to access his own home directory, with the Finder displaying a small red restricted symbol on directories of other users.
If you use Finder to open Macintosh HD on a fresh install of macOS, there will be four visible directories.
This directory is part of the Local domain. Here you’ll find all applications that came with macOS. Most third party applications added later will install to this directory by default.
This is also part of the Local domain. This directory is used by applications to store data that can be accessed by multiple users, for example configuration files and frameworks.
Welcome to the System domain. This is your computers OS. As a reminder: Never touch anything here or risk rendering your installation unstable or unbootable.
Every user existing on your installation of macOS has a separate home directory in /Users, and as you might have guessed, this is the User domain.
That’s just a quick overview of the directory structure of macOS. Feel like something’s missing? Please add it to the comments.