Making sense of linux filesystem hierarchy
I had been doing quite a lot of sys administration lately, for fun and professionally. I like adhering to standards and keeping things in respective directories.
The document that describes filesystem hierarchy standard, is quite big. Yes, I had to read it to put my OCD at ease. But here is the cheat sheet for you!
1 2 3 4 5 6 |
/bin & /sbin are for vital programs for the OS, sbin being for administrators only /usr/bin & /usr/sbin are for not vital programs, sbin being for administrators only /var is 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 is 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 is 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. |
Leave a Reply