Explanation of the directory hierarchy on Mac OS X

Solution 1:

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.