23

According to the Filesystem Hierarchy Standard the /bin directory should contain utilities needed in single user mode. In practice, many Linux distributions make the directory a symbolic link to /usr/bin. Similarly, /sbin is nowadays often a symbolic link to /usr/bin as well.

What's the rationale behind the symlinks?

1

1 Answer 1

21

Short summary of the page suggested by don_crissti:

Scattering utilities over different directories is no longer necessary and storing them all in /usr/bin simplifies the file system hierarchy. Also, the change makes Unix and Linux scripts / programmes more compatible.

Historically the utilities in the /bin and /sbin directories were used to mount the usr partition. This job is nowadays done by initramfs, and splitting the directories therefore no longer serves any purpose. The simplified file system hierarchy means, for instance, that distributions no longer need to fix paths to binaries (as they're now all in /usr/bin).

7
  • Well, if we no longer need to separate a /usr partition - why are we putting everything in /usr/bin rather than just moving everything out of /usr into /?
    – einpoklum
    Aug 1, 2022 at 19:20
  • Not sure why you'd want to move everything out of /usr.
    – rkhff
    Aug 31, 2022 at 12:45
  • 2
    Umm, things only got moved in to /usr because of storage constraints on ancient Unix machines. Nobody really needs the extra prefix. You said that storing executables in /usr/bin simplifies the hierarchy - well, storing them in /bin simplifies it even more.
    – einpoklum
    Aug 31, 2022 at 20:58
  • @einpoklum There are many use cases where you'd want /usr on a separate partition, including (very common) mounting it as read-only.
    – Ruslan
    Dec 18, 2022 at 18:29
  • @einpoklum at the bottom of the link given by don_crissti, about merging /usr into / : "This would make the separation between vendor-supplied OS resources and machine-specific even worse, thus making OS snapshots and network/container sharing of it much harder and non-atomic, and clutter the root file system with a multitude of new directories." Feb 22, 2023 at 12:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .