Note: Linux system root directory structure


Commonly used important directories are shown in the figure:

 

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

  • /boot:
    Here are some core files used when starting Linux, including some connection files and mirror files.

  • /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.

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

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

  • /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.

  • /lost+found :
    This directory is usually empty. When the system is shut down illegally, some files are stored here.

  • /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.

  • /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.

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

  • /proc :
    proc is the abbreviation of Processes (process), /proc is a pseudo file system (that is, a virtual file system), which stores a series of special files of the current kernel running state, this directory is a virtual directory, it It is a mapping of system memory, and we can obtain 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:

    echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
  • /root :
    This directory is the home directory of the system administrator, also known as the user with super authority.

  • /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.

  • /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.

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

  • /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.

    The sysfs 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.

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

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

  • /usr/bin:
    Applications used by system users.

  • /usr/sbin:
    More advanced management programs and system daemons used by superusers.

  • /usr/src:
    The default placement directory for the kernel source code.

  • /var :
    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.

  • /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.

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.

/etc : As mentioned above, this is the configuration file in the system. If you change a file in this directory, the system may not start.

/bin, /sbin, /usr/bin, /usr/sbin : This is the directory where the system presets the execution files. For example,  ls  is in  the /bin/ls  directory.

It is worth mentioning that  /bin and /usr/bin  are commands for system users (general users except root), while /sbin and /usr/sbin are commands for root.

/var : This is a very important directory. There are many programs running on the system, so each program will have corresponding logs, and these logs will be recorded in this directory, specifically in the /var/log directory. In addition The default placement of mail is also here.

The rookie tutorial link is as follows:

https://www.runoob.com/linux/linux-system-contents.html

Guess you like

Origin blog.csdn.net/weixin_49071468/article/details/129822966