Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hai LQ folks
Why some binaries are stored /sbin,/usr/sbin and /usr/local/sbin? What is the difference betweem them? Why shouldn't binaries are stored in one particular directory?
/usr is generally for user / administrator added binaries and similar as opposed to core system programs which form a core part of the distro. if you compile software from source, i.e. not from distro vendor provided packages then it'll end up in /usr/somewhere by default as you personally decided to add it. There are other motivations for a differentiation, and equally as many arbitrary historical reasons, but that's the general gist of it.
Also, /bin/ and /usr/bin/ are for programs that a normal user may run. /sbin/ and /usr/sbin/ are for programs that an administrator will run.
By default, a normal user doesn't have /sbin/ or /usr/sbin/ in their path.
In addition to the statements about "how it is", note that there is simply a lot of tradition here. You could put ALL of your executables in---eg---/bin and noone would know but you and your users. If you are setting up systems for general use, then stick to the standards.
After all, this is what Microsoft does.......
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
That Unix tradition was usually based on careful design.
- /sbin being located on the / directory is available at all times. It contains commands that need to be available at the very beginning of the OS initialization and at the shutdown end too.
- /usr/sbin might be in a different file-system, might be read-only and might be shared between different machines.
- /usr/local/sbin contains files not part of the OS. The local administrator is allowed to install commands here from various sources without risking to overwrite OS ones.
Installing all binaries in /bin might break the OSe as the same command name might exist in different directories. All but one instance of each would stay with such a scheme.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.