[Linux learning] Linux directory configuration

Linux directory configuration

In order to achieve effective management of resources, Linux manages the system itself and user data according to certain standards ( FHS file system level standard).

1FHS

The Filesystem Hierarchy standard focuses on planning what data should be configured under each directory. With this standard, users can find the corresponding system or user directories and files proficiently and quickly when they switch to other Linux systems, thus facilitating management to a certain extent. However , the Linux system is widely used and has many users. The planning of various files and directories cannot always be consistent. Therefore, FHS only provides recommended standards for the configuration of the three directories / , / usr and / var .

2. Linux directory classification

Shareable directory: a directory that can be shared with other systems for mounting

Unshared directory: system running configuration file or program-related socket file

mutable directory: frequently changed

Immutable directory: will not change, such as function library, etc.

 

shareable

unshareable

immutable (static)

/usr (where software is placed)

/etc (configuration file)

 

/opt (third-party software)

/boot (boot and kernel files)

variable (variable)

/var/mail (user mailbox)

/var/run (program related)

 

/var/spool/news (newsgroup)

/var/lock (program related)

 

3/

Root directory. All directories and files are derived from the root directory (this directory saves the directory items or data items of other derived directories or files), and this directory is mainly related to system startup, system repair and restoration, etc.

In order to prevent the system from crashing due to confusion or misoperation with other files or data, the root directory is often placed in a partition.

The following directories are generally configured in this directory:

/bin places commands that can also be operated in single-person maintenance mode

/boot places files that will be used for booting: Linux core files and boot menus and configuration files

/dev places device files

/etc places the main configuration files of the system

/home puts the user's home directory: ~ represents the home directory of the currently logged in user, and ~ dmtsai represents dmtsai 's chicken Amli

/lib places the function library of the system (the function library used at boot and called under /bin and /sbin )

/media places device files that can be accessed in one place

/mnt places devices that can be temporarily mounted

/opt is the directory where third-party helper software prevents ( additional software installed )

/sbin Commands used when the system is booted, repaired, and redeemed

/srv places some data directories that need to be used after the service program is started

/tmp where temporary files are placed

4/usr

Unix operating system software resource, the abbreviation of Unix software resource , this directory is the default software installation directory of all systems.

/usr/bin places commands that users can use (not boot-time commands)

/usr/X11R6 is the directory where important data of the X Window System is placed

/usr/include puts the included header file of the header file of the c/c++ file

/usr/lib places function libraries and object files of various application software

/usr/local places software installed by system administrators, and newer software can be placed

/usr/sbin places commands that are not required for the normal operation of the system

/usr/share places shared files

/usr/src places source files

5 / var

The /var folder mainly places some frequently changed files, including cache files, login files and files generated when the system is running.

/var/cache places some cache files when the program is running

/var/lib places the data files that need to be accessed during the running of each program, and each program creates an independent subfile

/var/lock places some mutually exclusive access device and device files or programs

/var/log where log files are placed

/var/mail to place personal emails

/var/run Some program runtime PID

/var/spool holds some data queued for use

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325726864&siteId=291194637