[New Star Project 2023] Linux directory structure

Author: Insist--

Personal homepage: insist--personal homepage

The author will continue to update network knowledge and python basic knowledge , looking forward to your attention

foreword

This article will explain the structure and function of the Linux directory, as well as the explanation of the directory. In the recent period, the basic knowledge about Linux will continue to be updated, and I look forward to your attention.

Table of contents

1. Linux directory structure and functions

1. Directory structure

2. Function

2. Catalog Explanation

1、/bin

2、/boot

3、/dev 

4、/etc

5、/home

6、/lib

7、/lost+found

8、/media

9、/mnt

10、/opt

11、/proc

12、/root

13、/sbin

14、/selinux

15、/srv

16、/sys

17、sysfs

18、/tmp

19、/usr

20. /usr/bin

21、/usr/sbin

22. /usr/src

23、/was

24、/run


1. Linux directory structure and functions

1. Directory structure

Today I will explain the Linux directory structure. Everyone knows that Linux has a characteristic, that is, " everything is a file " and all files start from "root (/)". "Root" is the first-level directory of Linux. There are many directories under the "root", and there are many files and directories under the directory. The cut head in the figure below represents the "hyperlink". One or more directories of , each has its own independent partition. When installing the operating system, it will be assigned manually. If it is not allocated, everyone will share a partition, but no matter what, it starts from the heel in terms of structure. It can be understood as: Any files and directories in Linux are under the root directory, and the following two-level directories automatically generated by the system have their own functions.

48334df62e7a45d8a54f2f6a3fc91c0d.jpg

2. Function

The specific functions of each are shown in the figure below. The orange boot directory in the figure is for storing configuration files. If the files in this directory are lost, the operating system cannot be started.

 d8340e08fac84c139430cc34dc198fb5.jpg

2. Catalog Explanation

In the Linux system, several directories are more important, and you need to be careful not to accidentally delete or change internal files at will. Such as: /etc, /bin, /sbin, /usr/bin, /usr/sbin are all important directories.

1、/bin

bin is the abbreviation of Binaries (binary files), this directory stores the most frequently used commands.

2、/boot

Stored here are some core files used when starting Linux, including some connection files and mirror files.

3、/dev 

dev is the abbreviation of Device (device), and the external devices of Linux are stored in this directory . The way of accessing devices in Linux is the same as the way of accessing files.

4、/etc

etc is the abbreviation of Etcetera (etc.), this directory is used to store all configuration files and subdirectories required for system management.

5、/home

The user's home directory . In Linux, each user has its own directory, which is generally named after the user's account, such as alice, bob, and eve in the above figure.

6、/lib

lib is the abbreviation of Library (library). This directory stores the most basic dynamic link shared library of the system, and its function is similar to the DLL file in Windows. Almost all applications need to use these shared libraries.

7、/lost+found

This directory is usually empty . When the system is shut down illegally, some files are stored here.

8、/media

The linux system will automatically recognize some devices, such as U disk, CD-ROM, etc. After recognition, Linux will mount the recognized devices to this directory.

9、/mnt

The system provides this directory to allow users to temporarily mount other file systems. We can mount the CD-ROM drive on /mnt/, and then enter this directory to view the contents of the CD-ROM drive.

10、/opt

opt is the abbreviation of optional (optional), which is the directory for installing additional software on the host. For example, if you install an ORACLE database, you can put it in this directory. Default is empty.

11、/proc

proc is the abbreviation of Processes (process), /proc is a pseudo file system (that is, virtual file system), which stores a series of special files of the current kernel running state, this directory is a virtual directory, it is the system memory Mapping, we can get system information by directly accessing this directory.

The content of this directory is not on the hard disk but in the memory . We can also directly modify some files in it. For example, the following command can be used to block the ping command of the host so that others cannot ping your machine:

12、/root

This directory is the user home directory of the system administrator, also known as the super authority .

13、/sbin

s is the meaning of Super User, which is the abbreviation of Superuser Binaries (binary files of super users), and the system management program used by system administrators is stored here .

14、/selinux

This directory is unique to Redhat/CentOS. Selinux is a security mechanism, similar to the Windows firewall, but this mechanism is more complicated. This directory is for storing selinux-related files.

15、/srv

This directory stores some data that needs to be extracted after the service is started.

16、/sys

This is a big change in the Linux2.6 kernel. A new file system sysfs in the 2.6 kernel is installed in this directory.

17、sysfs

The file system integrates the information of the following three file systems: the proc file system for process information, the devfs file system for devices, and the devpts file system for pseudo-terminals. The file system is a visual reflection of the kernel device tree. When a kernel object is created, corresponding files and directories are also created in the kernel object subsystem.

18、/tmp

tmp is an abbreviation of temporary (temporary). This directory is used to store some temporary files.

19、/usr

 usr is the abbreviation of unix shared resources (shared resources), this is a very important directory, many applications and files of users are placed in this directory , similar to the program files directory under windows.

20. /usr/bin

Applications used by system users.

21、/usr/sbin

More advanced hypervisors and system daemons used by superusers.

22. /usr/src

The directory where the kernel source code is placed by default.

23、/was

var is the abbreviation of variable (variable). This directory stores things that are constantly expanding. We are used to putting those frequently modified directories in this directory. Includes various log files.

24、/run

It is a temporary file system that stores information since the system was started. When the system restarts, the files in this directory should be deleted or cleared. If you have a /var/run directory on your system, it should point to run.

Guess you like

Origin blog.csdn.net/m0_73995538/article/details/131337740