LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   difference between /sbin /usr/sbin (https://www.linuxquestions.org/questions/linux-enterprise-47/difference-between-sbin-usr-sbin-682089/)

ram_rajavarapu 11-09-2008 12:46 AM

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?

acid_kewpie 11-09-2008 02:22 AM

/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.

jschiwal 11-09-2008 02:47 AM

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.

acid_kewpie 11-09-2008 03:46 AM

oh, and local directories are for data held on the local machine, rather than on a central server, e.g. nfs mount.

jschiwal 11-09-2008 03:31 PM

It might be a good idea to point out the "Filesystem Hierarchy Standard" publication at the www.tldp.org website.

pixellany 11-09-2008 03:41 PM

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.......;)

jlliagre 11-09-2008 10:29 PM

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.

pixellany 11-09-2008 10:40 PM

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.