Friday, September 19, 2008

Linux File System 07 - lib directory

/lib - This contains all the shared libraries that are required by system
programs. Windows equivalent to a shared library would be a DLL file.

Linux File System 06 - home directory

/home - Linux is a multi-user environment so each user is also assigned a
specific directory which is accessible only to them and the system
administrator. These are the user home directories, which can be found
under /home/username. This directory also contains the user specific
settings for programs like IRC, X etc.

Linux File System 05 - etc directory

/etc - This directory contains all the configuration files for your system.
Your lilo.conf file lies in this directory as does hosts, resolv.conf and
fstab. Under this directory will be X11 sub-directory which contains the
configuration files for X. More importantly, the /etc/rc.d directory
contains the system startup scripts. This is a good directory to backup
often. It will definitely save you a lot of re-configuration later if you
re-install or lose your current installation.

Linux File System 04 - dev directory

/dev - This is a very interesting directory that highlights one important
characteristic of the Linux filesystem - everything is a file or a
directory. Look through this directory and you should see hda1, hda2 etc,
which represent the various partitions on the first master drive of the
system. /dev/cdrom and /dev/fd0 represent your CDROM drive and your floppy
drive. This may seem strange but it will make sense if you compare the
characteristics of files to that of your hardware. Both can be read from
and written to. Take /dev/dsp, for instance. This file represents your
speaker device. So any data written to this file will be re-directed to
your speaker. Try 'cat /etc/lilo.conf > /dev/dsp' and you should hear some
sound on the speaker. That's the sound of your lilo.conf file! Similarly,
sending data to and reading from /dev/ttyS0 ( COM 1 ) will allow you to
communicate with a device attached there - your modem.

Linux File System 03 - boot directory

/boot - This directory contains the system.map file as well as the Linux
kernel. Lilo places the boot sector backups in this directory.

Linux File System 02 - bin directory

/bin - In contrast to /sbin, the bin directory contains several useful
commands that are used by both the system administrator as well as
non-privileged users. This directory usually contains the shells like
bash, csh etc. as well as much used commands like cp, mv, rm, cat, ls.
There also is /usr/bin, which contains other user binaries. These binaries
on the other hand are not essential for the user. The binaries in /bin
however, a user cannot do without.

Linux File System 01 - sbin directory

/sbin

This directory contains all the binaries that are essential to the working of the system. These include system administration as well as maintenance and hardware configuration programs.

You can find lilo, fdisk, init, ifconfig etc here. These are the essential programs that are required by all the users.

Another directory that contains system binaries is

/usr/sbin

This directory contains other binaries of use to the system administrator. This is where you will find the network daemons for your system along with other binaries that only the system administrator has access to, but which are not required for system maintenance, repair etc



The /usr/sbin directory contains non-vital system utilities that are used after booting (i.e., starting the system) by the system administrator.

This is in contrast to the /sbin directory, whose contents include vital system utilities that are necessary before the /usr directory has been mounted (i.e., attached logically to the main filesystem).

A few of the more familiar programs in /usr/sbin are adduser, chroot, groupadd, kppp, kudzu, ping, setquota, traceroute, userdel and xcdroast.

/usr/sbin also contains some daemons, which are programs that run silently in the background, rather than under the direct control of a user, waiting until they are activated by a particular event or condition. Among the daemons in /usr/sbin are crond, pppd, sshd and xinetd.

/usr/sbin is a subdirectory of /usr, which is used to store many application programs. Another subdirectory of /usr, /usr/bin, contains programs that are not required for booting or repairing the system. The directory /usr/local/sbin is used for locally installed system administration programs.

Because /usr/sbin's programs are not intended for running by ordinary users, it is not in the path (i.e., the set of directories that system searches to find commands) for such users, as is also the case with /sbin. This can easily be seen by using the echo command (which displays whatever follows it or its value) while logged in as an ordinary user to see the value of the $PATH variable (which contains the user's path), i.e.,

echo $PATH

However, /usr/sbin is in the root user's (i.e., administrative account's) path, as can be seen by using the same command when logged in as the root user.

As is the case with any directory, the contents of /usr/sbin can be viewed by using the ls command, i.e.,

ls /usr/sbin

Free Advertising