Tuesday, July 20, 2010

Linux Filesystem explained

The first thing to remember while working with linux is that in linux, everything is treated as a file or a directory.
There is nothing like C, D, E, H drives in linux operating system as in Windows environment. The root of the linux file system is "/" under which different partitions comes like /etc, /bin, /usr, etc.

The directory structure in linux is like as below :
/ - is the main partition in linux and all the other things comes under this.

When you just type "ls -p" inside your root(/) directory, you will get the output as below.

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

This is the directory structure of linux. Now each of the above is explained below.

/bin - contains the required binary files for administrating or running the linux system.

/dev - contains device related files.

/home - contains home folder for all the users on the system.

/proc - contains information about the linux kernel and hardware.

/sbin - contains the binaries which can only be run using the "root" user.

/usr - contains the installed programs and utilities.

/boot - contains the files required for the boot loader to boot the linux system.

/etc - contains all the configuration files.

/lib - contains all the software libraries.

/mnt - it is temporary mount point in linux.

/root - contains the files for "root"user.

/tmp - contains temporary files.

/var - contains the data like mails and system related logs are also stored here.

No comments:

Post a Comment