EmbLogic's Blog

Linux Filesystem Hierarchy.

/bin: it usually contains the shells like bash, csh, etc…. and commonly used commands like cp, mv, rm, cat, ls. For this reason and in contrast to /usr/bin, the binaries in this directory are considered to be essential. The reason for this is that it contains essential system programs
that must be available even if only the partition containing / is mounted.

/boot: This directory contains everything required for the boot process except for configuration files not needed at boot time and the map installer.Thus, the /boot directory stores data that is used before the kernel begins executing user?mode programs.

/dev : /dev is the location of special or device files.It is a very interesting directory that highlights one important aspect of the Linux filesystem ? everything is a file or a directory.
/etc: This is the nerve center of your system, it contains all system related configuration files in here or in its sub?directories. A “configuration file” is defined as a local file used to control the operation of a program; it must be static and cannot be an executable binary.

/home: Linux is a multi?user environment so each user is also assigned a specific directory that is accessible only to them and the system administrator. These are the user home directories, which can be found under’/home/$USER’ (~/).home directory contains personal configuration files, the so?called dot files. Personal configuration files are usually ‘hidden’, if we want to see them,we either have to turn on the appropriate option in our file manager or run ls with the ?a switch. If there is a
conflict between personal and system wide configuration files, the settings in the personal file will prevail.

/initrd: initrd provides the capability to load a RAM disk by the boot loader. This RAM disk can then be mounted as the root file system and programs can be run from it. Afterwards, a new root file system can be mounted from a different device. The previous root (from initrd) is then moved to a directory and can be subsequently unmounted.initrd is mainly designed to allow system startup to occur in two phases, where the kernel comes up with a minimum set of compiled?in drivers, and where additional modules are loaded from initrd.

/lib: The /lib directory contains kernel modules and those shared library images needed to boot the system and run the commands in the root filesystem, ie. by binaries in /bin and /sbin.Libraries are readily identifiable through their filename extension of *.

/media: This directory contains subdirectories which are used as mount points for removeable media such as floppy disks, cdroms and zip disks.The motivation for the creation of this directory has been that historically there have been a number of other different places used to mount removeable
media such as /cdrom, /mnt or /mnt/cdrom.

/mnt: This is a generic mount point under which you mount your filesystems or devices. Mounting is the process by which we make a filesystem available to the system. After mounting our files will be accessible under the mount?point. This directory usually contains mount points or sub?directories where we mount our floppy and our CD. we can also create additional mount?points here if we wish. Standard mount points would include /mnt/cdrom and /mnt/floppy. There is no limitation to creating a mount?point anywhere on our system. It should be noted that some distributions like Debian allocate /floppy and /cdrom as mount points while Redhat and Mandrake puts them in /mnt/floppy and /mnt/cdrom respectively.

/opt: This directory is reserved for all the software and add?on packages that are not part of the default installation. Any package to be installed here must locate its static files (ie. extra fonts, clipart, database files) must locate its static files in a separate /opt/’package’ or /opt/’provider’ directory tree.Generally, all data required to support a package on a system must be present within /opt/’package’, including files intended to be copied into /etc/opt/’package’ and /var/opt/’package’ as well as reserved directories in /opt.

/proc: /proc is very special in that it is also a virtual filesystem. It’s sometimes referred to as a process information pseudo?file system. It doesn’t contain ‘real’ files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc). For this reason it can be regarded as a control and information centre for the kernel. In fact, quite a lot of system utilities are simply calls to files in this directory.
For example,’lsmod’ is the same as ‘cat /proc/modules’ while ‘lspci’ is a synonym for ‘cat /proc/pci’.
By altering files located in this directory we can even read/change kernel parameters (sysctl) while the system is running.

/root: This is the home directory of the System Administrator, ‘root’. This may be somewhat confusing (‘root on root’) but in former days, ‘/’ was root’s home directory (hence the name of the Administrator account). To keep things tidier, ‘root’ got his own home directory.

/sbin: Linux discriminates between ‘normal’ executables and those used for system maintenance and/or
administrative tasks. The latter reside either here or ? the less important ones ? in /usr/sbin. Locally installed system administration programs should be placed into /usr/local/sbin. Programs executed after /usr is known to be mounted (when there are no problems) are generally placed into /usr/sbin. This directory contains binaries that are essential to the working of the system. These include system administration as well as maintenance and hardware configuration program.we may find lilo, fdisk,init, ifconfig, etc…. here.

/usr: /usr usually contains by far the largest share of data on a system. Hence, this is one of the most important directories in the system as it contains all the user binaries, their documentation, libraries, header files, etc…. X and its supporting libraries can be found here. User programs like telnet, ftp, etc…. are also placed here.

/var: Contains variable data like system logging files, mail and printer spool directories, and transient and temporary files. Some portions of /var are not shareable between different systems. For instance, /var/log, /var/lock, and /var/run. Other portions may be shared, notably /var/mail, /var/cache/man, /var/cache/fonts, and /var/spool/news.’/var’ contains variable data, i.e. files and
directories the system must be able to write to during operation, whereas /usr should only contain static data.

/srv: /srv contains site?specific data which is served by this system. This main purpose of specifying this is so that users may find the location of the data files for particular service, and so that services which require a single tree for readonly data, writable datand scripts can be reasonably placed. Data that is only of interest to a specific user should go in that users’
home directory.

/tmp: This directory contains mostly files that are required temporarily. Many programs use this to create lock files and for temporary storage of data. Many these files are important for currently running programs. and deleting them may result in a system crash. Usually it won’t contain more than a few KB anyway. On most systems, this directory is cleared out at boot or at shutdown by the local system

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>