The first article, the Linux directory structure

Source: Internet
Author: User

First, the directory structure of the Linux system:

1, logically all the directories have only one vertex/(root), all the starting point of the directory, the root is similar to an upside down tree-like hierarchy, tree-l show the number of layers, tree-l 1/show a layer under the root

2, the directory structure of Linux is regular, and is organized according to the category

such as application/usr/bin

Data files to help/usr/share

Configuration File/etc

Start command/ETC/INIT.D

Summary:

1) All Linux directory structure is a hierarchy of hanging upside down tree-shaped directory structure

2) root is the vertex of all directories

3) directory structure and partition devices are not related, that is, different directories can be across different disks or partitions

4) All catalogs are organized and ordered according to certain categories and rules

Absolute command and Relative command:

Absolute command: Starting from the root is the absolute command, such as: cd/data/

Relative command: As long as it is not starting from the root is relative command such as CD data/

Ii. Standard of catalogue hierarchy

1[Email protected] ~]# tree-l1/2/3 ├──bin4 ├──boot5 ├──dev6 ├──etc7 ├──home8 ├──lib9 ├──lib64Ten├──lost+found One ├──media A ├──misc - ├──mnt - ├──net the ├──opt - ├──proc - ├──root - ├──sbin + ├──selinux - ├──srv + ├──sys A ├──tmp at ├──usr -└──var
View Code

Directory Structure Purpose description

/store system-related programs, that is, Unixt ' program developed by

/USR the development program that stores UNIX system vendors can be defined as UNIX software resource

/usr/local Store the user's own installation of the program, equivalent to C:/Program files generally compile software when the default path

Yum or RPM package installation default path It's usually not here.

/OPT is used in some systems to store programs developed by third-party vendors, so named option means "optional"

Iv. introduction of the Linux directory structure

FHS Full Name: Chinese meaning directory hierarchy standard, is the directory standard specification of Linux

1, defines the two layer specification: the first layer is "/" directory of the directory should be put what file data

Such as:

The configuration file for the system in/etc directory such as/etc/exports./etc/hosts

/bin/sbin placing programs and system commands

2. The second layer is defined for the sub-directories of the/USR and/var two directories.

such as:/var/log placed system log files and other prompts:/var partition separate out

3. Catalogue Description

/bin: Common binaries are in the same directory as the/bin directory and/usr/bin

/boot Linux kernel-level boot system programming required file system

Directory for/dev device files

/etc a) configuration file default path for binary installation package (yum rpm) b) directory where service startup commands are stored (/etc/init.d/)

Home directory default data storage directory for normal users

/lib Library File storage Directory

/lost+found in the XT3 file system, but the system crashes unexpectedly or the machine unexpectedly shuts down, will produce some fragments here, but the system during boot-up process, the fsck tool will check here, and repair the corrupted file system, the system has problems, there may be files moved to this directory, It may take a manual way to fix it, or move the file to the original location

/MNT is typically a mount directory for temporary storage devices

/OPT indicates the optional meaning, some software installation packages are installed here, that is, custom packages, our own compiled packages, can be installed in this directory, through the source package installed software can./configure--profix=/opt/Directory

The process information and kernel information is stored here when the/proc operating system is running.

/sbin is mostly a store of commands that are designed to be managed by the user, and is the executable command repository for Superuser root

/tmp Temporary file directory, sometimes when users run the program, will produce temporary files

/usr system repository directory, such as commands, help files, etc.

/usr/bin User executable file directory

/usr/include the location of the header file of the program

/usr/lib Library file Directory

/usr/local local hierarchy (empty after main installation)

/usr/share/fonts Font Directory

/usr/share/man Help Catalog

/usr/share/doc Document Directory

/USR/SRC Source Code Source directory

The directory of/var variable data

/var/lib is used to store some library files, such as MySQL and MySQL database storage, logging and caching

/var/log/messages System log file directory

/var/log/secure system security information file that can be viewed here to see who is cracking his system

/var/spool/cron configuration file path for timed tasks

Summary

/dev/Equipment Catalog

/etc/configuration files and directories for service startup

/proc display kernel and process information virtual file system

/tmp Temp file directory

/home directory for ordinary users

/var directory, typically a directory of log files

/usr user programs, and directories for data, help files, etc.

Directories for/bin and/sbin and/usr/sbin/user commands

5. Important Sub-directories

1,/etc/sysconfig/network-scripts/ifcfg-eth0 Configuration network address and GW

/etc/hosts sets the corresponding parsing table for the user IP and first name (or domain name), equivalent to the local LAN internal DNS

/etc/fstab record boot a file to mount file system/etc/rc.local

/etc/inittab set the INIT process to set the system to what kind of runlevel and load the related boot file configuration when the system starts

/etc/exports Setting the configuration file for NFS Network File system

/etc/sysconfig/network can modify the machine name and network card start, gateway and other configuration

/etc/rc.local the file that holds the Boot program command (Chkconfig can only manage startup services for Yum installed programs)

/ETC/INIT.D This directory is used to store the system or server scripts that are launched in Systems v mode

/ETC/XINIT.D if the server is running through xinetd mode, his script will be placed in this directory, some systems do not have this directory, such as Slackware these old versions are not

/etc/profile system Global environment variable configuration path

/ETC/PROFIE.D a directory in which the system login program is loaded, the command or file exists independently

The first article, the Linux directory structure

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.