Linux study notes (2) -- Linux directory structure

This article takes as CentOSan example

basic introduction

  • LinuxThe file system adopts a hierarchical tree directory structure .
  • The top level of this structure is the root directory " /".
  • LinuxEverything in the system is a file .

View root directory contents

Open the root directory " /" and view the contents of the current directory.

cd /
ls

root directory.png

Analysis of each file in the root directory

Root directory structure.png

Commonly used directories
  • /bin
    Binary abbreviation, this directory stores cdcommonly used commands.


  • What /sbins represents Super Useris that the system management program used by the system administrator is stored here to maintain the system. Common ones include reboot, ifconfigetc.

  • /home
    stores the home directories of ordinary users. LinuxEach user in /home has his own directory, and the directory name is the user account name.

  • /root is the system administrator directory and also becomes the user home directory of
    the super privileged person (i.e. ).Super User

  • /lib
    is the most basic dynamic link shared library required for system startup, similar to the files Windowsin DLL. Most applications need to use these shared libraries.

  • /etc
    All configuration files and subdirectories required for system management.

  • The /usr
    directory is very important. Many of the user's applications and files are stored in this directory, similar to the directory Windowsin program files. Among them /usr/localis the installation directory provided to the host for additional installation software, which is usually a program installed by compiling source code.

  • /boot
    stores startup linux-related core files, including some connection files and image files. Kernel initrd, vmlinux, gruband other files are in this directory.

  • /media
    Some devices automatically recognized by the Linux system, such as USB flash drives, optical drives, etc., will be mounted in this directory after the system recognizes them.

  • The /mnt
    system provides this directory to allow users to temporarily mount other file systems. For example, shared folders are usually mounted in /mnt/hgfs/the directory. (For details, please see the record of VMware setting up Linux and Windows shared folders ).

  • /opt
    opt represents opitional, this is the directory where additional installed software is stored for the host, and is empty by default.

  • /var
    This directory stores continuously expanding data. Frequently modified files are usually placed in this directory. For example, system log file ( /var/log), email ( /var/mail), print queue ( /var/spool), etc.

Be careful with directories

These directories involve files that are operated by the system. Once modified, they may cause the entire system to crash.

  • /proc
    is a virtual directory, which is a mapping of system memory. Information such as system processes can be obtained by accessing this directory.

  • /srv
    is the abbreviation of service. This directory stores some data that needs to be extracted after the service is started.

  • /sys
    All configuration files and subdirectories required for system management.

Other directories
  • /tmp
    is a directory used to store some temporary files. Once the system is restarted, the files in this directory will be deleted.

  • /dev
    stores hardware information, similar to Windowsthe device manager, Linuxwhich maps and stores all hardware devices in the form of files, including files such as cpu.disk

  • /lost+found
    This directory is usually empty and is used to store some related files when the system is shut down illegally.

  • /selinux
    is security-enhanced linuxa SELinuxsecurity subsystem that controls programs to only access specific files.

Guess you like

Origin blog.csdn.net/qq_22255311/article/details/123152817