Linux Study two -Linux The directory structure of the system

stay Linux Under the root directory of , There are a lot of directories , But remember , about Linux for , Everything is a document . So the directory here is also a file . use ls / Command can see all kinds of different directories under the root directory .


root directory , Every file and directory starts at the root .

Only root The user has write permission under the directory .


binary User binary command file

Contains binary executables .

In single user mode , Common things that need to be used Linux All commands are in this directory . All commands used by users of the system are set here .


System boot loader file , Contains files related to bootloader .

Kernel initrd、vmlinux Files such as /boot Next .


device Device file

These include terminal devices 、USB Or any device connected to the system .


The configuration file . Contains all the configuration files required by the program .

Also included for starting / Stop the startup and shutdown of individual programs shell Script .


HOME The home directory of ordinary users .


library Library files needed for software or command operation .


library What software or commands need to run 64 Location files .


Disk or file system corruption , power failure , Temporary file location

While checking the disk , Put the lost files here .


Mobile media devices

Temporary directory used to mount mobile devices .


Mount Directory

Temporary mount point ( Mount the cd-rom ), The system administrator can mount the file system .

12、/opt - Optional add-on applications

option Represents optional .

Include additional applications from third parties .

Additional applications should be installed in /opt/ perhaps /opt/ Subdirectory of .


process The directory of the process , Information about system processes ( kernel process Software )


Highest authority root User's home directory .


Contains binary executables

super binary Super command , Only root Users can execute .


SELinux(Security-Enhanced Linux) Security enhanced Linux It's the national security agency (NSA) For the implementation of mandatory access control , It's a security mechanism , yes Linux The most outstanding new security subsystem in history .NSA Is in Linux With the help of the community, an access control system has been developed , Under the restriction of this access control system , A process can only access files that it needs in its task .SELinux Default installed in Fedora and Red Hat Enterprise Linux On , Also available as an easy to install package on other distributions .

SELinux It's a group for Linux Core patches , And provide some stronger 、 More secure mandatory access control architecture to work with core major subsystems . Based on the principles of confidentiality and integrity , It provides a framework to force the separation of information , To deal with *** Threat or any application that attempts to bypass the security architecture . To limit the damage that malicious or poorly designed programs may cause . It contains a set of templates for security policy configuration files to match general security goals .

Details refer to :



srv On behalf of service

The database directory that the system can access when starting the service

Contains server specific service related data .


System driver file


temporary Where the system and users create temporary files , Default 15 The system will delete it automatically

All users can create 、 Delete file .


Store user data 、 Program

Contains binaries 、 The library files 、 Source code for documentation and secondary programs .


variable Changeable documents , Variable file , Files where content can grow

Such as system log file (/var/log); Package and database files (/var/lib); E-mail (/var/mail); Print queue (/var/spool); Lock file (/var/lock); Multiple restarts of required temporary files (/var/tmp)


attach :Linux Directory structure mind map

source :