Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone explain (or more likely, point to a good article that explains) what the various directories should be used for. (I assume the structure is very similar on all Unix based machines, though maybe I'm wrong about this).

Having just made the switch from windows to OSX for my dev machine I'm a bit overwhelmed by the directory structure so, for example when PHP Pyrus setup asks me to choose a directory to store PEAR packages in, I haven't a clue what is a sensible choice.

share|improve this question

OS X has both a user-friendly directory structure (with top-level folders named /Applications, /System, /Users, /Library), as well as a standard Unix directory hierarchy that is hidden in Finder (/bin, /etc, /var, /usr, ...) — those folders are documented in man hier.

Additionally, there are differences between the Unix directories (at least as used in OS X), and those you'd find in Linux: For example, the latter has /srv.

The best explanation is probably in the developer documentation by Apple, which is too long to be quoted here. Note that at the moment, the linked article is both for iOS (at the top) and OS X (further down).

Where to place files also depends on the realm the application comes from: It makes sense to place Unix libraries in /usr/local/lib or similar directories, while OS X libraries would be e.g. in /Libraryor similar. Some tools (Perl, Python, Ruby) were configured to work with the latter file system structure.

share|improve this answer

This article explains the top level file hierarchy:

Apple's BSD layer under, /usr is inline with the Filesystem Hierarchy Standard

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.