Linux

Linux directory Structure

This section provide the knowledge of directory structure of Linux. If you are well acquainted with the directories of windows, then you will learn easily the directory structure of Linux by comparisons.

Introduction

In the Linux operating system, all file systems are contained within one directory hierarchy. The root / directory is the top level directory, and all its subdirectories make up the directory hierarchy. It is like a tree structure.

Subdirectories

The directories bin, sbin, lib, usr, var, boot, dev, etc, home, mnt, proc, root, tmp, lost+found, opt, as shown in figure below
Linux Directory Structure
Linux Directory Structure

The Linux File system Hierarchy

Directories structure of Linux listed below.

/

The root is the top directory in the Linux file system. It is denoted by /. (forward slash) It is equivalent to the system drive (C:\ ) in Windows.

/boot

In Linux, this is the directory containing the kernel, the core of the operating system. Also in this directory are files related to booting the system, such as the bootloader (vmlinuz).

/bin

The /bin directory contains executable (binary files) programs such as ls and cp.

/dev

This directory contains files with information about devices, either hardware or software devices, on the system. devices can include the floppy drive, CD-ROM drive and hard disk.

/etc

The /etc directory contains configuration files which are local to the machine.

/home

The /home directory contains user account directories. Each user created by the system administrator will have a subdirectory under /home with the name of the account. E.g. User account for mohit is created, his home directory will be located in /home/mohit. All her personal files will reside in this directory. This directory is synonymous with "C:\Documents and Settings\" in Windows XP/200x or "C:\Users\" in the Vista and Windows Server 2008 world.

/lib

The /lib directory contains libraries files that are required to boot the system as well as containing files required by various programs such as chdir and mv.

/lost+found

The /lost+found directory contains Each partition has its own lost+found directory. This directory is used to find out lost data from the corresponding partition.

/mnt

The /mnt directory used for mounting temporary file systems. When you insert the disc into CD-ROM the standard mount point location is /mnt/cdrom.

/proc

The /proc directory provides information about running processes and the kernel. The following commands will give you this information:
$ cat /proc/cpuinfo - Display CPU information of system.
$ cat /proc/meminfo - Display RAM information as well as swap space capacity and usage.

/root

The /rootdirectory is the home directory for the super user (root).

/sbin

The /sbin This directory similar to /bin, this directory contains executable programs needed to boot the system. This directory mostly contain administrative tools, that should be made available only to the root.

/tmp

The /tmp This is the directory where temporary files are placed. This is similar to the C:\Temp directory under Windows.

/usr

The /usr The directory structure within /usr appears similar to the root directory structure. Some directories located within /usr include:

/var

The /var Files in /var are dynamic contains data that is changed when the system is running normally.

/opt

The /opt directory is used for storing random data that has no other logical destination.




admin