Search code examples
unixpathsuserhel

Meaning of Path Structure on Unix


Does anybody have a reference to what the various path names mean on different flavors of Unix? Please include Solaris, RHEL, and SLES in the list if possible.

e.g. From what I have gathered /lib is standard libraries for the distribution, which never change (is this correct? or do they get new versions from time to time?), /usr/local is for apps installed by the sysadmin, etc. But I am not sure that this is correct and I'm still unclear about the difference between /usr/lib and /lib (the former is for sysadmin installed libraries?) and /sbin and /bin and so on... Thanks.


Solution

  • Most Linux distributions follow the Filesystem Hierarchy Standard FHS (at least mostly). Big parts of it are simply rules that have been true for UNIX for quite some time (/usr, /var, ...), others are rather new (/media, ...).

    One thing that I found confusing initially is the existence of both /bin and /usr/bin as well as /lib and /usr/lib with a seeemingly random distribution of where stuff goes. The reasoning behind this split is that /usr might be mounted from a different storage (possible remote) than the root so /bin and /lib should contain a minimal system that is enough to get the whole system up and running in the event of some system failure.

    So Gnome, GIMP and so on can go in /usr, as they are not essential, but filesystem-tools such as fsck and mkfs as well as the shell sh need to reside in the non-usr directories.