Live data from Hacker News

Linux Directory Structure (File System Structure) Explained with Examples

thegeekstuff.com

1–10 of 26 posts

Re: Linux Directory Structure (File System Structure) Explained with Examples

#5
post #4

So /usr/local implies that the binaries were built for the local machine, and might not work elsewhere?

Generally, or "local to the site".

In the mid-80's to 90's when disk space was at a premium, it was quite common to have one big file server that had the /usr/local, /opt, /home, etc. hierarchies on it, shared out over NFS to the other desktop machines on the network.

As most/all of the machines would be similar architectures, they could share the binaries. In cases where there was more than one architecture, there would frequently be multiple file servers, one per arch. Another remnant of this on modern systems: "/usr/share" usually contains data like machine-independent help files that could be mounted across architectures.

The result of this was that users could hotseat from machine to machine, and site-specific software would only need be installed once, which was a space/complexity win.

Re: Linux Directory Structure (File System Structure) Explained with Examples

#7
post #4

So /usr/local implies that the binaries were built for the local machine, and might not work elsewhere?

/usr/local/ is a place to put software that's not managed the same way. It keeps the systemwide package management from overwriting or otherwise disrupting software it doesn't know about.

Software in /s?bin/ /usr/s?bin/ /usr/lib/ etc. is not guaranteed to work on another machine. A binary could be for a different architecture, even if it was installed by the main package manager. You can't copy /usr/bin/ binaries from an arm platform to an x86 platform, for instance. You can't copy optimized crypto software using aes-ni instructions to pre-aes-ni systems; it'll crash. You can't even reliably copy binaries from a different machine with the same cpu model, if the machines are using different package sets that will result in library incompatibilities.

Re: Linux Directory Structure (File System Structure) Explained with Examples

#10
And if you want more technical details, the Filesystem Hierarchy Standard is the place to look:

  http://www.pathname.com/fhs
  http://www.pathname.com/fhs/pub/fhs-2.3.html
Somewhat Linux-specific, but worth reading even if you're on OS X, as much of the content is the same.
Post reply on HN