← Back to context

Comment by paulddraper

4 days ago

1. The title says “understanding sbin” but the content gives zero understanding of that. If someone has a historical explanation, please provide it.

2. “Then somebody decided /usr/local wasn't a good place to install new packages, so let's add /opt”

Not exactly. /usr/local exists so you don’t accidentally mess up your distro/package manager by changing its files. It’s “local” to your installation. But it is still structured — /usr/local/bin, /usr/local/lib, etcetera — divided into binaries, shared libraries, manpages.

Whereas /opt has no structure. It’s “the wild west”…application binaries, libraries, configuration, data files, etcetera with no distinction. Apps with “universal” packaging, or sometimes secondary package managers.

For example /usr/local/bin is normally part of PATH, but /opt is not (unless eg homebrew adds it to your bashrc).

What do you mean?

  • I mean the article doesn’t explain sbin. The author symlinks it to bin but doesn’t explain why it exists.

    • I'm believe /sbin was introduced/standardized in System V Release 4. It's present in SVR4 (1988) but not in SVR3 (1987). Another candidate is would be some old BSD (check 4.2 or 4.3 (1986) if anyone has a running system).

      I'm guessing it was introduced to finally move out all the (mostly system) binaries from /etc, which in ancient Unix from Bell Labs in the 1970s really meant "etc", as in stuff that didn't fit elsewhere rather than system config files, so it contained binaries like init, mount, umount.