Linux architecture----the role of common first-level subdirectories under the Linux root directory

Article directory


The first-level subdirectories under the Linux root directory play an important role, and each subdirectory has its specific role and function. The following are common subdirectories under the Linux root directory and their functions:

  1. /bin(Binary):

    • Function: Stores the basic commands required for system startup and recovery. These commands usually do not depend on other file systems, so they are available before the file system is mounted.
    • Example: Basic commands such as ls, cp, mv and so on.
  2. /boot

    • Function: Contains the configuration file and kernel image for starting the boot loader (Boot Loader). This is an important part of the system boot process.
    • Example: vmlinuz, initramfs, grub directories.
  3. /dev(Device):

    • Function: A directory containing all device files in the system. Everything in Linux is a file, and devices are no exception.
    • Example: sda (hard disk device), tty (terminal device), etc.
  4. /etc(Etcetera):

    • Function: Stores system global configuration files and scripts. These files control system behavior and service configuration.
    • Example: passwd, fstab, network directory, etc.
  5. /home

    • Function: Store the user's personal directory. Each user has his own subdirectory.
    • 例子:/home/user1、/home/user2。
  6. /lib(Library):

    • Function: Contains shared library files, which are used by the system and applications.
    • Example: libc.so, libm.so, etc.
  7. /media

    • Function: Temporarily mount the directory of removable media devices (such as CDs, USB drives).
    • Example: /media/cdrom, /media/usb.
  8. /mnt(Mount):

    • Function: Directory used to manually mount temporary file systems or other devices.
    • Example: /mnt/iso, /mnt/data.
  9. /opt(Optional):

    • Purpose: Used to store optional software packages and applications, usually provided by third parties.
    • Example: /opt/google/chrome.
  10. /proc(Process):

    • Function: A virtual file system that provides information about the system and processes and can be used to interact with the kernel.
    • Example : /proc/cpuinfo, /proc/meminfo.
  11. /root

    • Function: The home directory of the root user, usually the working directory of the super user.
    • Example:/root.
  12. /run

    • Function: Store temporary files and information needed when the system is running. They are created when the system starts and are deleted when it is shut down.
    • 例子:/run/lock、/run/user。
  13. /sbin(System Binary):

    • Function: Contains system commands used by system administrators and root users, usually related to system maintenance and repair.
    • Example: ifconfig, fdisk.
  14. /srv(Service):

    • Function: Used to store data files and directories of specific services, such as website files of a web server.
    • Example: /srv/www, /srv/ftp.
  15. /sys(Sysfs):

    • Function: Provide information about the kernel and devices for the configuration and monitoring of kernel parameters.
    • 例子:/sys/kernel/debug、/sys/class。
  16. /tmp(Temporary):

    • Function: Used to store temporary files, which will be cleared when the system restarts.
    • Example:/tmp.
  17. /usr(Unix System Resources):

    • Role: Contains most user and system applications, library files and data.
    • Example: /usr/bin, /usr/lib, /usr/share.
  18. /var(Variable):

    • Function: Store frequently changing files, such as logs, caches, databases, etc.
    • 例子:/var/log、/var/cache、/var/lib。

These are common roles and examples of subdirectories one level below the root directory. Each subdirectory plays an important role in the system and helps organize and manage different aspects of the system.

Guess you like

Origin blog.csdn.net/redrose2100/article/details/134738905