Introduction to Linux - A Hands on Guide | Linux Bible | Linux From Scratch | A Newbie's Getting Started Guide to Linux | Linux Command Line Cheat Sheet | More Linux eBooks

Sunday, 22 September 2013

Know About Important Directories In Linux & Their Contents


This is the root directory and this is where the file system starts. It mainly consists of a number of subdirectories.


This directory includes the Linux kernel file called vmlinuz along with boot loader files.


This directory maintains the configuration files of the system in the text format.

/etc/passwd file bears the necessary information relevant to each user of the system.

/etc/fstab file carries a table of devices that need to be mounted on every system reboot.

/etc/hosts file contains the information of the network hosts and IP addresses that are essentially known to the system.

/etc/init.d directory carries the scripts which start several system services mainly at the time of booting.

/bin and /usr/bin

The above two directories carry most of the programs required by the system. The /bin directory contains the important programs required by the system to operate, whereas /usr/bin has various applications for the users of the system.

/sbin and /usr/sbin

These two sbin directories maintain programs, to be used by superuser mostly, that are useful in system administration.


This directory maintains various things which support their corresponding user applications.


This directory has the files supporting the X Window system


This directory has the dictionaries used for the spelling check purposes.


This directory has variety of documentation files in various formats.


This directory stores the man pages.


This directory contains source code files. Whenever you install the kernel source code package, the whole Linux kernel source code can be found in this directory.


/usr/local directory along with its subdirectories are useful at the time of installing any new software (softwares those come as a pre-installed packages with the official distribution are usually found in /usr/bin directory)and other files to be used on the local machine. Whenever you try to install a software on your system, they must be installed in the /usr/local directories (any one of them) and most common choice is the /usr/local/bin directory.


This directory has those files which change when the system is in running state.


This directory maintains log files which get updated when the system is in running state. You must check the contents of this directory periodically to supervise your system’s health.


This directory holds the files which are queued and waiting for some process, just like mail messages and printing tasks. Whenever any mail is received by the local system, it is stored in /var/spool/mail.


This directory stores shared libraries (analogous to DLLs in other operating systems).


This directory is where a user stores his own work most of the times.


This directory is where a superuser stores his work oftenly or it is the home directory for a superuser.


Running programs can store their temporary files in /tmp directory


This directory has the information about devices which are available to the system. Just like Unix, in Linux devices are manipulated like files. These devices can be read and written treating them as files.

For example, /dev/sda is the first hard drive on your system.


The /proc directory is of a special kind as it is entirely virtual. You can find plenty of numbered entries in /proc directory, every such entries points to the corresponding process running on the system. Also, several named entries which can be viewed, can be found in this directory and these ones help to permit access to the current configuration of the system.

Just see /proc/cpuinfo and it will show you something that the kernel thinks of the CPU.

/media and /mnt

For any hard drive to be available to the users, it should be mounted at first. The /media directory is used in relevance with the mount points.

Whenever the system boots, it checks the /etc/fstab file which carries a table of devices that explains a particular device is supposed to be mounted at a specific mount point in the directory tree. In most of the desktop editions of Linux, /media directory is owned by the automatic device mounting mechanisms. In case of some systems which require manual device mounting (floppy drives or CD drives), the /mnt directory makes an appropriate place available for mounting those devices.

1 comment:

  1. Thank you for your detail introduction ^.^