I get a snapshot of Linux directory: you see there have arrow points to another directory.
/bin -> /usr/bin /sbin -> /usr/sbin /usr/tmp -> /var/tmp
23 Answers
I don't know why that screenshot contains the arrows. These should not be related. (turns out they ARE related.. see the comment at the bottom).
The answer to your question though is...
/bincontains executable files that are part of the core operating system. These files need to be accessible before/usrgets mounted. (for instance, themountcommand is in/bin/mount)./usr/bincontains executable files that are not part of the core operating system. These are considered to be "system wide binaries".
/sbin and /user/sbin are the same setup.. only the utilities in these directories generally require root privileges. The 's' is for superuser (aka root) but USED to stand for standalone (as in static linkage with no dependencies).
As long as we are at it, why not address /usr/local/bin ?
The local part of the tree is for things that are specific to the host (as in not common to all instances of the operating system). Often programs you install outside of the package system will put binaries here.
/tmpis for temporary data that is intended to be cleaned out fairly quickly. Usually cleared at least every 10 days. Many profiles will clear this out on each reboot too./var/tmpis usually for more persistent data (but still "throw away"). Usually cleared around every 30 days. Often not cleaned out on reboot.
Keep in mind. Linux is a free operating system that anyone can contribute to and author code for and as so, these things are guidelines and not rules. Linux is still (and might remain) "the wild west".
See the other posts on UsrMerge (specifically what the diagram is all about).
@user1686 blessed us with the following information: (thanks!)
Arrows indicate symbolic links. I think SunOS 4 might have been the first OS to symlink /bin to /usr/bin – it had only the 'mount' command in /sbin (the "s" used to be for "standalone" or "statically linked"; as in not depending on /lib; but everybody forgot that).
The picture you posted seems to be a visualization of what's called UsrMerge, described in detail here. Good quick writeup of the benefits of symlinking these together.
It's meant a relatively safe way of simplifying the filestructure of Linux. Different distros handle these directories differently, so symlinking them together can resolve many compatibility issues in various applications.
This link provides context on why it's set up the way it is in the first place.. long story short, it's a vestigial organ necessary to work around hardware limitations in the 70s.
Once there was a time, where storage was expensive. In these times /usr was a NFS share on a "huge" fileserver. As mentioned in an answer already the /bin and /sbin contained the needed files to boot till the NFS mount was possible (e.g. the mount command needs to be there to before you can mount something).
Actually in Android you can sometimes still see this split and in systems, where the root filesystem is on ROM and mounted with overlay. There it could be possible to put additional software under /usr, without changing the core system.
Modern Desktop Linux distros do not see the need of the split anymore and merge all to /usr. As mentioned above see UsrMerge.