Skip to content

Instantly share code, notes, and snippets.

@robert-claypool
Created November 18, 2015 05:18
Show Gist options
  • Save robert-claypool/c3dce9853bd301a41474 to your computer and use it in GitHub Desktop.
Save robert-claypool/c3dce9853bd301a41474 to your computer and use it in GitHub Desktop.
Unix/Linux Standard Filesystem Paths

Basically (and very roughly), the standard paths on Unix are:

  • /bin & /sbin for vital programs for the OS, sbin being for administrators only ;
  • /usr/bin & /usr/sbin for not vital programs, sbin being for administrators only ;
  • /var for living data for programs. It can be cache data, spool data, temporary data (unless it's in /tmp, which is wiped at every reboot), etc. ;
  • /usr/local for locally installed programs. Typically, it hosts programs that follow the standards but were not packaged for the OS, but rather installed manually by the administrator (using for example ./configure && make && make install) as well as administrator scripts ;
  • /opt for programs that are not packaged and don't follow the standards. You'd just put all the libraries there together with the program. It's often a quick & dirty solution, but it can also be used for programs that are made by yourself and for which you wish to have a specific path. You can make your own path (e.g. /opt/yourcompany) within it, and in this case you are encouraged to register it as part of the standard paths ;
  • /etc should not contain programs, but rather configurations.

If your programs are specific to the services provided by the service, /srv can also be a good location for them.

From http://serverfault.com/a/96420/5254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment