LinuxBasics.org

The community that helps people to run Linux

rss

What happened to C:\Programs?

Somebody on a mailing list wrote:

There is something that puzzles me as a Linux newbie. I have found the
command locations /bin, /sbin, /usr/bin, and /usr/sbin. I am searching
for the logic behind all these locations. I do understand that sbin is
reserved for commands of an administrative nature, whereas bin commands
are more general. What I fail to see the logic in is the reasoning
behind having command directories off both the root (/bin, /sbin) and
then also off of usr (/usr/bin, /usr/sbin).

The reason is hidden in the network-heritage of linux and explained in the Filesystem Hirarchy Standard (FHS).

Remember that in Unix/Linux each directory can be mounted from a separate disk, partition or even across the network.

So as you guessed correctly, /sbin and /usr/sbin are for root, while /bin and /usr/bin are for “mere users”. This is not a security measure, /sbin could also be available to users! It is just for convenience.

/bin and /sbin are part of the /-Filesystem, thus they are available if only that one filesystem is mounted. They contain all commands that are neccesary in this early stage of booting. Look at /sbin: There are such basic commands like mount and ifconfig used to mount other drives and bring the network up.

/usr/bin and /usr/sbin (maybe even all of /usr) can be mounted across the network (or from another partition) and thus cannot contain essential commands which might be needed before networking is up.

You might even have /usr/local/bin and /usr/local/sbin, which contain commands which are not installed with the package-manager (but by root).

And you can have /home/xyz/bin which contains commands which are installed by user xyz.

In my opinion, the Filesystem Hirarchy Standard is a very nice reading, which explains a lot about linux-philosophy and why things are the way they are :)


Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.


Linux® is a registered trademark of Linus Torvalds.


 
  tutorials/using/what_happened_to_c_programs.txt · Last modified: 2008/07/20 19:08

LinuxBasics.org

Start Linux-Course Tutorials Linux Links Security Blog Forum E-mail List Search Online Chat

Site-Info

Help Get in Touch Making of LBo

Wiki-Control

Powered by

Linux Apache DokuWiki Mailman RUTE ht://Dig