13

From the filesystem hierarchy standard, /usr/local would be for "local data, specific to this host." But I don't quite understand that, since isn't the entire filesystem usually local to the host? i.e. /bin contains binaries, and those binary files will only be used to invoke processes on this host, generally speaking. A second host would have its own copy of binaries, though they might actually be the same if you diffed them.

So, can you explain the meaning of "local data"? In what sense is it local?

  • For an example, my workplace has some of the /var folders as network drives. This allows sharing of stuff everyone needs and simplifies the process of ensuring everyone has the same files. Also, having a personal folder on the network drive ensures it's easy to back things up and work with clusters. But the network drive is slower and local SSDs are preferred for "regular" use. – Kat Oct 19 '17 at 20:45
  • I think the description is simply wrong. In my experience, it has almost always meant something more like "specific to this organization", not a particular machine. – Barmar Oct 20 '17 at 17:35
20

since isn't the entire filesystem usually local to the host?

No, sharing the read-only parts (e.g. all of /usr or even the entire /) across the network was actually quite common.

Although I think that's not the point. "Specific to this host" can also mean not provided by the distribution – it's software you've built and installed by hand, as opposed to the rest of /usr containing generic packaged files (which would indeed be the same across many hosts).

For example, many source code build systems use /usr/local as the default install location. If you just run ./configure && make && make install, it will dump everything to /usr/local/bin and such.

10

Expanding on the answer by @grawity:

The term "local" stems from a time, when there was only a single UNIX. In this context, all systems running the same version would have a big set of files identical between all hosts, with accordingly only a minority of other files differing between hosts.

These non-universal files would either be configuration data in /etc, or optitional files in /opt or "something else, local to the host" - i.e. */local.

In modern times, when there are (wildly) different members of the UNIX family tree and storage requirements for the OS being a tiny fraction of the total storage typically available, many coming in different flavours (*BSD, Linux distros), the term "local" has been watered down, maybe even into a historical relict.

  • I thought there were certainly multiple different Unixen by the time they started cramming binaries and stuff in /usr – grawity Oct 17 '17 at 4:56
  • 5
    (On the other hand... all systems running the same version of Debian also have a big set of files identical between all hosts. There doesn't need to be "a single UNIX" for that.) – grawity Oct 17 '17 at 5:06
  • @grawity That's exactly the point: "all Debians" is not the same as "all UNIX-y OSes" today. But at the time the standard was conceived, this was very close to reality. – Eugen Rieck Oct 17 '17 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.