Linux file system - the role of the root directory folder

ls / can list all directories under the root directory

System startup must:

  • /boot : stores the kernel files used when starting Linux , including connection files and image files.
  • /etc : stores all the configuration files and subdirectory lists required by the system , and changing the files in the directory may cause the system to fail to start.
  • /lib : store the basic code library (such as c++ library), which is similar to the DLL file in Windows. Almost all applications need to use these shared libraries, such as: gcc, python, java, etc.
  • /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, the corresponding files and directories are also in the kernel object subsystem

Command set:

  • /bin : Stores the most commonly used programs and commands, such as: cp, ls, grep, cat, etc.
  • /sbin : programs and commands that only system administrators can use, such as: useradd, userdel, vsfted, etc.

External file management:

  • /dev : The abbreviation of Device (device), which stores the external devices of Linux . Note: Accessing devices and accessing files is the same in Linux. Store all device files , including hard disk, partition, keyboard, mouse, USB, tty, etc.
  • /media : Other Windows-like devices, such as U disk, CD-ROM, etc., after recognition, Linux will put the device in this directory.
  • /mnt : To temporarily mount other file systems , we can mount the CD-ROM on /mnt/, and then enter this directory to view the contents of the CD-ROM.

Temporary 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.
  • /lost+found : Generally, it is empty. After the system is shut down illegally, some files are stored here.
  • /tmp : This directory is used to store some temporary files.

account:

  • /root : The user home directory of the system administrator.
  • /home : The user's home directory, named after the user's account.
  • /usr : Many applications and files of the user are placed in this directory, similar to the program files directory under windows. Used to store files and directories directly related to system users, such as applications and the library files that support them.
  • /usr/bin : Applications and commands used by system users.
  • /usr/sbin : More advanced management programs and system daemons used by superusers.
  • /usr/src : The default directory where the kernel source code is placed.

During operation, use:

  • /var : store frequently modified data , such as log files of program operation (under the /var/log directory).
  • /proc : Manage memory space! The virtual directory is the mapping of system memory, we can directly access this directory to obtain system information. The content of this directory is not on the hard disk but in memory, and we can also directly modify some files in it to make changes. Store all processes marked as files , which are identified by process numbers or other system dynamic information, such as the cpuinfo file stores the data of the current working status of the CPU.

For extension:

  • /opt : It is empty by default, and we can install additional software here ( as a storage directory for optional files and programs, mainly used by third-party developers to easily install and uninstall their software packages ).
  • /srv : store the data that needs to be extracted after the service starts (empty if no server is used)

View file system type

cat /etc/fstab

df -T -h

mount

file -s /dev/sda1

parted

/etc/filesystems: The type of test mounted file system specified by the system
/proc/filesystems: The type of file system that has been loaded by the Linux system

Guess you like

Origin blog.csdn.net/qq_34474071/article/details/123483865