difference between /sbin /usr/sbin
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. |
oh, and local directories are for data held on the local machine, rather than on a central server, e.g. nfs mount.
|
It might be a good idea to point out the "Filesystem Hierarchy Standard" publication at the www.tldp.org website.
|
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.......;) |
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. |
I agree with what jlliagre says---I was being a bit flip to make a point. Of course the tradition has a "raison d'etre".
|
All times are GMT -5. The time now is 07:17 AM. |