Google


Get this widget!










Understanding Linux Files System

tux-born-2-frag-xp.jpg

Changing from windows to Linux can get confusing especially when navigating the Linux filesystem. Linux filesystem does things a lot more differently than the Windows filesystem. Everything starts from the root directory, known as ‘/’, and then
expands into sub-directories. Where DOS/Windows had various partitions and
then directories under those partitions, Linux places all the partitions under the root directory by ‘mounting’ them under specific directories.


In Windows, the various partitions are detected at boot and assigned a
drive letter where as Linux mount a partition or a device, the system does not know of the existence of that partition or device. This might not seem to be the easiest way to provide access to your partitions or devices but it offers great flexibility.

This approach known as the unified filesystem and it offers several advantages over that Windows uses. Let’s take the example of the /usr directory. This directory off the root directory contains most of the system executables. With the Linux filesystem, you can choose to mount it off another partition or even off another machine over the network. The
underlying system will not know the difference because /usr appears to be a local directory that is part of the local directory structure.

Another point likely to confuse newbies is the use of the frontslash ‘/’ instead of the backslash ” as in DOS/Windows. Linux is not going against convention here.
Unix has been around a lot longer than Windows and was the standard a lot
before Windows was.

Linux also chooses to be case sensitive. What this means that the case, whether in capitals or not, of the characters becomes very important. So THIS or ThIs is two different entity.

Given below is the result of a ‘ls -p’ in the root directory.

bin/ dev/ home/ lost+found/ proc/ sbin/ usr/
boot/ etc/ lib/ mnt/ root/ tmp/ var/

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

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

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

/dev - One important characteristic of the Linux filesystem - everything is a file or a
directory. Look through this directory and you should see hda1, hda2,
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. Both can be read from and written to. Sending data to and reading from /dev/ttyS0 ( COM 1 ) will allow you to communicate with your modem.

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

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

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

/lost+found - Sometimes your system might crash or a power failure might take the machine down and at the next boot, a lengthy filesystem check using fsck will
be done. Fsck will go through the system and try to recover any corrupt
files that it finds. The result of this recovery operation will be placed
in this directory.

/mnt - This directory usually contains mount points or sub-directories where you mount your floppy and your CD. You can also create additional mount-points here if you want. There is no limitation to creating a mount-point anywhere on your system but convention says that you do not litter your file system with mount-points.

/opt - This directory contains all the software and add-on packages that
are not part of the default installation. You can find KDE and
StarOffice here.

/root - We talked about user home directories earlier and well this one is
the home directory of the user root. This is not to be confused with the
system root.

/tmp - This directory contains mostly files that are required temporarily.
Many programs use this to create lock files and for temporary storage of
data.

/usr - This is one of the most important directories in the system as it
contains all the user binaries. User programs like telnet, ftp etc are also placed here.

/var - This directory contains spooling data like mail and also the output
from the printer daemon. The system logs are also kept here in
/var/log/messages.

This was a short and basic look at the Linux filesystem if you think linux is the next operating system that will dominate the world, a more comprehensive understanding is crucial.


0 Responses to “Understanding Linux Files System”

  1. No Comments

Leave a Reply







 Subscribe in a reader

Enter your email address:

Delivered by FeedBurner

WidgetBucks - Trend Watch - WidgetBucks.com