Linux FHS (filesystem Hierarchy Standard)

Source: Internet
Author: User

Filesystem Hierarchy Standard (FHS): Specifies the files in the main directories under the root directory.

Linux directory configuration: According to the FHS definition, the file content in each directory should be:
/: Root directory. There is only a directory in this directory, and there cannot be files directly. Is the first partition to be loaded when the system starts. Therefore, all the files used during the startup process should be placed in this partition. For example, the five directories/bin/etc/lib/sbin/dev should be in the same directory as the root directory and cannot be independent of a partition.

/Bin/usr/local/bin: directory for storing executable binary files. For example, the LS command.

/Boot: Mainly stores the files used during Linux Startup. Linux core files will be used at startup. vmlinuz files under this directory are the core of Linux. If the boot program is grub, there is also the/boot/GRUB directory in this directory.

/Dev: in Linux, any device is stored in this directory as a file. Accessing the files under this directory is equivalent to accessing a device.

/Etc: almost all the major configuration files of the system are stored in this directory, such as the empty code file of the personnel account and the starting file of various services. Only the root permission can be changed. This directory is almost a plain text file of ascll. Important files include:/etc/inittab init. d modprobe. conf X11 fstab sysconfig, etc. Important directories include:
/Etc/init. d: the default startup script for all services is here. For example, to start or disable iptables:/etc/init. d/iptables start
/Etc/xinetd. D: The setting file directory of various services managed by the super daemon.
/Etc/X11: All configuration files related to X Window are located here, especially the setting files of Xorg. conf or xf86config X-server.

/Home: the default home directory ),~ Indicates the Home Directory of the current user, and ~ Dmtsai indicates the Home Directory of dmtsai.

/Lib/usr/local/lib: directory of the function library used by the system. The/lib/modules directory contains core modules.

/Lost + found: if an exception occurs in the system and an error occurs, some lost fragments are stored in this directory. Generally, this directory automatically appears in the top-level directory of a partition. Full-time loading of hard disks in/disk will automatically generate a directory like this:/Disk/lost + found

/Mnt/media: This is the default loading point of a floppy disk and a CD. A floppy disk is usually attached to a floppy disk, and a CD is attached to a/mnt/CDROM disk./media and/mnt are somewhat similar.

/OPT: directory for additional software installation on the host. However, in the previous Linux system, we used to put it in the/usr/local directory.

/Proc: The Directory itself is a "Virtual File System ". The data it stores is in the memory, such as the system core, forming information, external device status and network status. Because the data in this directory is in the memory, it does not occupy any hard disk space. Important files include/proc/cpuinfo/proc/DMA/proc/interrupts/proc/ioports/proc/NET.

/Root system administrator's home directory.

/Sbin/usr/local/sbin: run commands that are used by system administrators, such as fdisk mke2fs fsck mkswap mount. Unlike bin, these directories are used for root system management. However, the execution files in the directory can be used by general users to "View" but cannot be set.

/Srv: The data directory to be accessed by some services after they are started. Example: The webpage data required by the 3w server may be stored in/srv/www.

/Tmp: temporary directory. Is accessible to anyone.

/Usr: contains the main program of the system, the files required for the graphic interface, additional function libraries, software installed on the local machine, and shared directories and files. In fact, it is a bit like the combination of "Program Files" and "winnt" folders in windows. Important directories in this directory include:
/Usr/bin/usr/sbin: directory for files that can be executed by common users and administrators;
/Usr/include: header files and inclusion file placement in C/C ++ and other programming languages;
/Usr/lib: directory where the function library files of each application are stored.
/Usr/local: default directory of software installed on the local machine. This option also applies to the/OPT directory.
/Usr/share: directory where shared files are stored, as shown in the following two directories:
/Usr/share/DOC: place some system help files.
/Usr/share/MAN: manpage file directory.

/Usr/src: directory for storing Program Code related to the Linux system.
/Usr/x11r6: almost all the execution files required by X Window System in the system are stored here.

/Var: Mainly stores files that change frequently during system execution. For example, a cache (catch) or a log file that can be changed at any time ). In addition, some database files, such as MySQL databases, are written during software execution.
The following main directories are:
/Var/cache: some temporary storage disks during program running.
/Var/lib: directory where data files are stored during program execution. For example, the locate database, MySQL, rpm, and other database systems are all written in this directory.
/Var/log: directory of the logon file. /Var/log/messages is the file for managing all logon files.
/Var/lock: Some devices have the one-time writing feature. The tab (tape drive) locks the device during writing.
/Var/run: after some programs or services are started, their PIDs are placed in this directory.
/Var/spool: stores queue data. For example, the host will put the email in/var/spool/mail. If the email cannot be sent, it will receive the/var/spool/mequeue directory, the user's job assignment (cron) is placed in/var/spool/cron.

Startup data is usually stored in/etc, and personal data is usually stored in/usr in/home.

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.