Linux file System hierarchy standard

Source: Internet
Author: User

The goal of this standard is to define the standard path of the Linux file system, allowing developers and users to find what they need in a reasonable location.

The general idea of the Linux file layout is to divide the files and directories into the following 3 groups:

Files and directories that are unique to a particular system running Linux, such as startup scripts and configuration files.

Read-only files and directories that can be shared between different systems running Linux, such as executable applications.

A readable and writable directory, such as a user's home directory, that can be shared between different systems running Linux or other operating systems.

The top-level structure defined by FHS contains some subdirectories and a small number of optional directories that must exist.

/bin: Contains binaries that can be used by the root user and normal standard users, and they can all run in single-user mode, which can be run separately if some other directory structures are not yet loaded. For example, the core commands, such as cat and LS, can be found here as well, including the command sh.

/boot: This directory is where the files that are used to start the Linux system are placed. These files are usually small and the file length does not exceed 100MB.

/dev: A special device file mapped to hardware is placed in this directory. For example,/DEV/HDA maps to the first IDE disk.

/home: Not required. The directory where the user files are to be placed. Under normal circumstances, each user will have a subdirectory in this directory that is the same as their login name, and this subdirectory is their default login directory.

/etc: The configuration file is placed in this directory. The most famous file in the/etc directory may be the passwd file, which contains information about the user in the system. Other useful files are fstab (list partition mount options), hosts (which lists the mappings of IP addresses and hostnames), httpd directories (configuration files containing Apache servers).

/lib: This directory is where the basic shared libraries and kernel modules are placed, especially those files that need to be used when the system boots or the system is in single-user mode.

/media: This top-level directory is used to contain other subdirectories that Mount removable media. The goal is to eliminate unnecessary top-level catalogs, such as/cdrom and/floppy.

/MNT: This directory is just for users to temporarily load some other file system.

/OPT: This directory is used by software vendors to add software to the system. This directory is primarily open to third-party vendors.

/root: Not required. This directory is where the root user files are placed.

/sbin: This directory places commands that are normally used only by the system administrator, as well as commands that need to be used when the system starts or enters single-user mode. The commands fsck, halt, and Swapon are in this directory.

/srv: This directory places a site-specific read-only profile and is not yet universally available.

/tmp: Temporary files placed under this directory. The system will usually (but not always) clean up the directory at startup.

/usr: This is a fairly complex level two file system, which in this directory will typically contain commands and libraries for all system classes except those required to enter single-user mode at system startup. It contains many subdirectories, such as/bin,/lib,/X11R6,/local.

/var: the data placed in this directory will change frequently, such as queue files for printing, log files for applications, and mail queue directories.

Linux file System hierarchy standard

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.