LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 11-09-2008, 12:46 AM   #1
ram_rajavarapu
Member
 
Registered: May 2008
Posts: 44

Rep: Reputation: 15
Post 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?
 
Old 11-09-2008, 02:22 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
/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.
 
Old 11-09-2008, 02:47 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 11-09-2008, 03:46 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
oh, and local directories are for data held on the local machine, rather than on a central server, e.g. nfs mount.
 
Old 11-09-2008, 03:31 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
It might be a good idea to point out the "Filesystem Hierarchy Standard" publication at the www.tldp.org website.
 
Old 11-09-2008, 03:41 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.......
 
Old 11-09-2008, 10:29 PM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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.
 
Old 11-09-2008, 10:40 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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".
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/sbin/service crond unable to start - gives permission error on /usr/sbin/crond mgervacio Linux - Newbie 6 07-16-2008 01:03 PM
What is difference between /usr/sbin/ps & /usr/ucb/ps command rajaniyer123 Solaris / OpenSolaris 6 07-05-2007 12:53 PM
/usr/sbin and /sbin world read/executable... why? lazlow69 Slackware 3 04-29-2004 05:06 PM
As root, not seeing /sbin and /usr/sbin in path weghman Linux - Newbie 3 04-25-2004 01:06 PM
/sbin vs /usr/sbin !?!?!? different? sirpelidor Red Hat 1 10-24-2003 03:33 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 09:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration