Search

Top Posts

Comments

  • TvvitterBug: Nice article! I think the Twitter client landscape has really changed in 2010. New approaches and design...
  • DistortedLoop: I’ve been putting electronics in ziplock bags for years as a quick and dirty water-RESISTANT...
  • inket: Underwater pictures ? ^^
  • echo_host: Im running 10.6 and noticed that nothing was working, in apps or in terminal. I found out you need to...
  • Felipe: Hi, i have the same problem that ronan. I have 21 cycles, 3 months ols and a 95% of capacity. I’ve done...

Categories

Recent Posts


Mac OS X Directory Structure explained

If you have ever looked at your Mac’s root directory and wondered what some of those other directories are for, you’re probably not alone. Mac OS got a whole lot more complex with the advent of OS X, adapting a unix file structure that is largely unfamiliar to Mac OS 9 and Windows users. So just what is /System, /Library, /usr, and all the others for anyway? Here’s a brief explanation of each directory as found in Mac OS X.


By default, if you look in the root of your Mac’s hard disk you’ll see some unfamiliar sounding directories. From the command line, you will see even more if you type ls /. Explained in no particular order:

Directory Description
/Applications Self explanatory, this is where your Mac’s applications are kept
/Developer The Developer directory appears only if you have installed Apple’s Developer Tools, and no surprise, contains developer related tools, documentation, and files.
/Library Shared libraries, files necessary for the operating system to function properly, including settings, preferences, and other necessities (note: you also have a Libraries folder in your home directory, which holds files specific to that user).
/Network largely self explanatory, network related devices, servers, libraries, etc
/System System related files, libraries, preferences, critical for the proper function of Mac OS X
/Users All user accounts on the machine and their accompanying unique files, settings, etc. Much like /home in Linux
/Volumes Mounted devices and volumes, either virtual or real, such as hard disks, CD’s, DVD’s, DMG mounts, etc
/ Root directory, present on virtually all UNIX based file systems. Parent directory of all other files
/bin Essential common binaries, holds files and programs needed to boot the operating system and run properly
/etc Machine local system configuration, holds administrative, configuration, and other system files
/dev Device files, all files that represent peripheral devices including keyboards, mice, trackpads, etc
/usr Second major hierarchy, includes subdirectories that contain information, configuration files, and other essentials used by the operating system
/sbin Essential system binaries, contains utilities for system administration
/tmp Temporary files, caches, etc
/var Variable data, contains files whose contents change as the operating system runs

If we forgot anything, or if something isn’t properly described, feel free to chime in with comments.

Posted by: Editor

Share

Save big on Mac Deals from Amazon.com

Comments:

Comments: 17

Comment from Martin Hauser
Time: March 30, 2007, 1:39 am

nice thing, though, i think you missed /private out!

Comment from akiko
Time: March 30, 2007, 3:00 am

how about /sw ?

Comment from Hardy Boys and the Case of the Missing Directory
Time: March 30, 2007, 10:36 am

/private, /sw, /opt

are three more I have that aren’t listed, are they install specific?

Comment from Ben Hanson
Time: March 30, 2007, 9:25 pm

/sw is specific to Fink
/opt is common elsewhere, in OS X it probably means you installed DarwinPorts
/private should probably be on the list.

Comment from bongo
Time: April 2, 2007, 5:12 am

actually, /etc is a symlink to /private/etc, like /tmp and /var are to /private/tmp and /private/var. Furthermore, you should point out that /private/var/log/ contains all the system logs.

Now what I never understood is the real difference between /System/Library and /Library….

Comment from 2omega
Time: June 10, 2007, 3:16 pm

>Now what I never understood is the real difference between /System/Library and />Library….

As U have it understood, /Library holds preferences, fonts, screen savers and the such that are available to all users and not just /Users/auser/Library.
/System/Library is more like services and extensions (similar to os 9) but very different. Thats is my guess.

My question is.. where would one logically install *nix software on OS X. Lets say I want to install Image Magick. Where should I place it? mysql get put into /usr/local/ and php gets put into /usr/lib/. This lib/local stuff has me confused.

Comment from You
Time: November 23, 2007, 10:13 am

> This lib/local stuff has me confused.

/usr is used for files installed through a package manager, such as MacPorts

/usr/local is used for files installed manually, such as something you have compiled. Putting them in /usr/local keeps them separate from the mess of files stored in /usr so it’s easier to manually remove the files (since there isn’t a package manager to do it for you).

Comment from Sunny Rabbiera
Time: November 30, 2007, 8:08 pm

[quote]> This lib/local stuff has me confused.

/usr is used for files installed through a package manager, such as MacPorts

/usr/local is used for files installed manually, such as something you have compiled. Putting them in /usr/local keeps them separate from the mess of files stored in /usr so it’s easier to manually remove the files (since there isn’t a package manager to do it for you). [/quote]

Yeh we have the same thing here on linux, that is because both OSX and linux are based on unix one way or another (OSX can be considered more “true” unix though as its based on BSD that is mostly derived from unix, linux however is based more off of minix)
the whole usr/local thing makes perfect sense to me, as we have something pretty much like it here in linux land

Comment from Gerhard Leonhartsberger
Time: March 8, 2008, 5:07 am

Look at Apple.com to see a high level description.

http://developer.apple.com/documentation/Darwin/Reference/ManPages/man7/hier.7.html#//apple_ref/doc/man/7/hier

Comment from Angelito Sampang
Time: May 16, 2008, 1:06 am

Hi,

Where can I find /Applications /etc /Network? are these files deletable? If they are, how can I delete them? and how will this affect the OS?

Thanks

Comment from Ben
Time: May 18, 2008, 3:49 pm

> Where can I find /Applications /etc /Network? are these files deletable? If
> they are, how can I delete them? and how will this affect the OS?

In Finder, Go… Go to Folder and type /Applications or whatever folder you want to get to (shift-command-g for keyboard shortcut people).

Deleting any hidden files is never a good idea unless you know what you’re doing. Deleting the /etc directory will probably make your computer unbootable at the very least.

Why would you want to delete that in the first place?

Comment from midilogic
Time: May 20, 2009, 2:54 pm

Hi,

Does /Users/$User/Desktop exist in any Mac OS 10.x, 9.x, etc.

Thx

Comment from Alexander Orlov
Time: August 13, 2009, 3:51 pm

“ls -lash /” shows me a “/home” folder on my Mac OS X.5. Is this a system created resp. for the system relevant folder or is it a folder I’ve created myself accidentally as I’m (or was :) a long-term Linux user?

Would be nice of you guys to type “ls -lash /” and tell me if you have also a “/home” folder on your system.

Pingback from I threw Out java on accident – Mac-Forums.com
Time: August 19, 2009, 10:01 am

[...] directory or your machine wouldn’t be working (if it was, it wouldn’t be working very well). See here for an explanation for the directories on your Mac. Note the description for /System: "System [...]

Pingback from OS 10.4 – Junk Files In System Folder/Library Folder – Mac-Forums.com
Time: October 13, 2009, 4:36 pm

[...] This would be a good start for understanding the directory structure in OS X. If you want your machine to run optimally, use a tool designed for that. There is no need to risk damage by manually manipulating files in directories that you are completely unfamiliar with. I consider myself fairly proficient with OS X for example but I would never manipulate the files in /System by hand. __________________ Upgrading to Snow Leopard FAQ : Incompatible Software for Snow Leopard : 64-bit and Snow Leopard – What 64-bit means for you Website : Twitter M-F MotM – April 2009. [...]

Pingback from Struktura katalogów MacOs X « SheepLogic Blog
Time: December 28, 2009, 11:35 am

[...] tak to wklep w terminalu polecenie # man hier. Znalazłem też ciekawy artykuł na ten temat w sieci (polecam przeczytanie komentarzy). Kategorie:Uncategorized Komentarze (0) Trackbacki (0) [...]

Comment from Abhishek
Time: January 12, 2010, 11:14 pm

i have a /home directory, inside that i am not able to create a directory using even “root” user any clue ?.

Write a comment






March 30th, 2007