title: OSX Directory Structure
created: 2014-06-07

OSX Directory Structure

If you are new to Mac world and especially if you are coming from Windows environment, you might look at OS X system directories and wonder what are those directories for.

ls top level folders on OS X

As OX X is POSIX compliant you can list top level directories with following command

ls -1 -d /

In a nutshell it means list in single column directories only in a top level

What is POSIX?

POSIX (from Portable Operating System Interface) defines standards of portable API for Unix-like operating systems.

Mac OSX is Unix-based system (it has been certified as such), which makes it POSIX compliant. Compliance guarantees availability of certain system calls.

Check out wikipedia if you want to know more about POSIX.

Organisation of OSX top level directories on mac

OS X directory structure is composed from both mac user-friendly and Unix based directories. Former directories start with capital letters such /Applications, /System, /Users, /Library. Linux directories are all other directories starting from lowercase letter and those will be hidden in finder, with some differences.

You can type man hier into your terminal to view full documentation for Unix based folders.

Checkout developer documentation on apple website to learn more about iOS (at the top) and OS X (further down) file system structure.

/

Slash represent of top level location of main (system) hard drive

/Applications

It is self-explanatory folder, where most of installed applications will reside. To install new application you can in most cases drag and drop it into /Application folder.

/Developer

Developer folder appears only when you will install XCode Development Tools.

/Library

Library is a folder for third party operating system add-ons. Everything that is added to that folder will affect the global functionality the OS X. It means that altered functionality will apply to all users unless there is additional setup to modify that.

/Network

This folder relates to domain control or LDAP (Lightweight Directory Access Protocol) directory services (Open Directory or Active Directory. Those can be enabled to distribute directory over Internet Protocol (IP). If those environment are not in use directories most likely be empty.

/System

System folder is reserved for Apple OS X. It contains your parts of the operating system.

/User Information

That is usually symlink to a folder located at /Library/Documentation. It contains various license and documentation files.

/Users

This folder might contain two or more subdirectories, one created for each user account added to the system. Those are auto generated by system every time new account is created, named after short name of user account and called "home folders".

/Volumes

Default location for mounting all media attached to mac. In most cases mounts will be done dynamically upon connection or disconnection of any device. This folder is equivalent to linux /mnt or /media folders.

/bin

It is directory for all essential common binaries. Those files and programs are responsible for booting (starting) and running the operating system.

/cores

Directory dumps of programs upon crash along with the state at the time it crashed. /cores is a useful folder for programmers debugging their programs.

/dev

Dev is a short for devices. This folder holds all device files representing peripheral devices such us keyboards, mice, trackpads, cameras, dvd rives and others.

/etc

This is directory is a symbolic link to etc -> private/etc which stores local system configuration, administrative files and scripts.

/home

On OS X this directory reminds empty. Refer to a /Users directory for more information.

/net

In Linux file hierarchy directory is an repository for the socket abstraction and the network protocols. If you type df in the console you will see

map -hosts    0    0    0    100%    0    0  100%   /net
map -hosts    0    0    0    100%    0    0  100%   /net

/opt

This is not default folder that you can find on clean installation of OS X. /opt comes by default with MacPorts.

If you want to completely uninstall MacPorts follow official uninstall instructions. If in the process you deleted some applications you can install them with Homebrew which also has OpenSSL and many other applications you might need.

/private

Private folder holds entire OSX unix core. Many root level folders are just symlinks to private subfolders, ex:

etc -> private/etc
tmp -> private/tmp
var -> private/var
etc -> private/etc
tmp -> private/tmp
var -> private/var

/sbin

Stands for “System (or Superuser) Binaries” and contains main system utilities, such as ifconfig, mount, halt, etc. Those are fundamental to both-single and multi-user environments and required to to start, maintain and recover the system.

/tmp

This is directory is a symbolic link to etc -> private/tmp which contains all system temporary files that will be removed after system restart

/usr

Second major hierarchy, includes subdirectories that contain information, configuration files, and other essentials used by the operating system.

/var

This is directory is a symbolic link to etc -> private/var. It stores multi-purpose log, temporary, transient, and spool files. "Var! stands for "variable" and is location for files that may change often – especially in size (emails, process-ID locks)

Published by IndieForger