Directory structure of linux
As a usually very organized Virgo, I like to store things in small, organized teams rather than in a big bucket. The use of directories helps me store and find the files I want. Directories are also referred to as folders because they can be thought of as folders that store files in a physical desktop analogy. Today, we discuss Linux directory structure with Linux training in Chandigarh.
In Linux and many other operating systems, directories can be built in a hierarchical tree structure. The Linux directory structure is defined and documented in the Linux File System Hierarchy Standard (FHS). When accessing these directories, these directories are implemented by using deeper directory names such as / var / log and / var / spool / mail. These are called paths.
The following table replenish a brief list of well-known and defined top-level Linux standard directories and their purpose.
|/ (root filesystem)||The root file system is the top directory of the file system. It must contain all the files required by the Linux system that was started before other file systems were installed. It must contain all the necessary executables and libraries needed to boot the remaining file system. After the system is booted, all other file systems will be installed as subdirectories of the root file system on a standard, well-defined installation point.|
|/bin||The /bin directory contains user executables.|
|/boot||Contains the static boot loader and kernel executables and configuration files needed to start a Linux computer|
|/dev||This directory contains device files for each hardware device connected to the system. These are not device drivers, but rather files that represent each device on the computer and are easy to access.|
|/etc||Contains the host’s local system configuration file.|
|/home||The home directory of the user file is stored. Each user has a subdirectory in / home.|
|/lib||Contains the shared library files needed to boot the system.|
|/media||Install the location of an external removable media device (such as a USB thumb drive) that may be connected to the host.|
|/mnt||Temporary mount points on regular file systems (for example, in non-removable media) can be used by an administrator to repair or process file systems.|
|/opt||Optional files (such as vendor-provided applications) should be located here.|
|/root||This is not the root (/) file system. It is the root user’s home directory.|
|/sbin||System binary file. These are executable files for system management.|
|/tmp||Temporary directory. The operating system and many programs are used to store temporary files. Users may also temporarily store files here. Please note that files stored here may be deleted at any time without notice.|
|/usr||These are shareable read-only files, including executable files and libraries, man files, and other types of documents..|
|/var||Variable data files are stored here.This can include log files, MySQL and other database files, web server data files, email inboxes, etc.|
Table : Linux filesystem hierarchy
The directories and their subdirectories and their subdirectories shown in Table 1 are considered part of the root file system. That is, they cannot be created as separate file systems and are installed at startup. This is because they (especially their contents) must appear at startup to allow the system to start properly.
The /media and /mnt directories are part of the root file system, but they do not contain any data. Instead, they are only temporary mount points
The remaining directories (directories with no background color in Table 1) do not need to exist in the boot sequence, but will be installed during the boot sequence so that the host can perform useful work.(FHS) refer to the official Linux File System Hierarchy Standards make it sure in these directories and their many subdirectories. Wikipedia also has a good description of FHS. This standard should be adhered to as far as possible to ensure the consistency of operation and function. This hierarchical directory structure is the same regardless of the file system type used on the host.
If you have questions, please add them to the comments below and I will try to answer them.