The structure is defined by the Filesystem Hierarchy Standard 3.0, which could be implemented differently depending on the distro. /bin is usually a symlink pointing to /usr/bin.
See also (if you’re curious) two distros that purposefully don’t follow the FHS for one reason or another: GoboLinux and NixOS (there are probably others)
I love how in the first page of chapter 2 they specify the distinction of files in two classes: shareable and variable.
Then they specify that files which differ in any of these two properties should belong to a different root folder.
Then they go ahead and give you an example which clearly explains that /varshould contain both shareable and non shareable files.
Good job with your 4 categories, I guess that’s why nobody really understands what /var is…
Is /var really such a mystery? I always understood it as the non-volatile system directory that can be written into. Like log files, databases, cache etc. /var/tmp it’s somewhat weird because a non-volatile temporary folder for me is just cache, and /var/lib is named somewhat weird because it doesn’t hold what I’d usually call libraries.
Indeed, but organisation is quite a mess and certain things don’t really feel like should be together.
Why should /var/www and /var/lock be in the same place?
It’s been a while I don’t work on webservers, but any of the ones I worked on, be it Apache or Nginx, had all their domains in /var/www.
I would imagine /srv to be a much better option, but I’ve never seen it done that way.
Well, at least for nginx, you can specify the root (or alias if required) directive; to me, it makes very little sense to rely on defaults, you need to specify your servers / virtual hosts anyways, might as well make the configuration more self-documenting…
The structure is defined by the Filesystem Hierarchy Standard 3.0, which could be implemented differently depending on the distro. /bin is usually a symlink pointing to /usr/bin.
See also (if you’re curious) two distros that purposefully don’t follow the FHS for one reason or another: GoboLinux and NixOS (there are probably others)
There’s also https://uapi-group.org/specifications/specs/linux_file_system_hierarchy/ nowadays, which aims to build on the FHS.
I love how in the first page of chapter 2 they specify the distinction of files in two classes: shareable and variable. Then they specify that files which differ in any of these two properties should belong to a different root folder. Then they go ahead and give you an example which clearly explains that
/varshould contain both shareable and non shareable files.Good job with your 4 categories, I guess that’s why nobody really understands what
/varis…Is /var really such a mystery? I always understood it as the non-volatile system directory that can be written into. Like log files, databases, cache etc. /var/tmp it’s somewhat weird because a non-volatile temporary folder for me is just cache, and /var/lib is named somewhat weird because it doesn’t hold what I’d usually call libraries.
Indeed, but organisation is quite a mess and certain things don’t really feel like should be together. Why should
/var/wwwand/var/lockbe in the same place?Well,
/var/wwwis in fact not part of the FHS, not even optional… it doesn’t exist on my machines either. I think the better choice would be/srv/wwwwhich is an example given at https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s17.htmlIt’s been a while I don’t work on webservers, but any of the ones I worked on, be it Apache or Nginx, had all their domains in
/var/www. I would imagine/srvto be a much better option, but I’ve never seen it done that way.Well, at least for nginx, you can specify the
root(oraliasif required) directive; to me, it makes very little sense to rely on defaults, you need to specify your servers / virtual hosts anyways, might as well make the configuration more self-documenting…