A. linux File system path description
Familiar with Windows systems, all know the file path representation, such as C:\User\rich\Documnets\test.doc.
In Linux, a directory called the virtual directory root directory is root, and directories and files under the root directory are listed in the directory path to which they are accessed. such as:/home/rich/documnets/test.doc (Slash is the opposite of Windows system). The path itself does not provide any information about exactly which physical disk the file resides on. The first hard drive installed on a Linux PC is called the root drive. The root drive contains the core of the virtual directory, and the other directories are built from there.
Creating some special directories on the root drive is called mount point. Mount points are directories in the virtual directory that are used to allocate additional storage devices. Virtual directories cause files and directories to appear in these mount point directories, but in fact they are stored in a different drive.
Usually the system files are stored in the root drive, and the user files are stored in another drive, such as:
The above shows two hard drives in the computer. A hard disk is associated with the root directory of the virtual directory. The remaining hard drives can be mounted anywhere in the virtual directory structure. In the example above, the second drive is mounted to the/home location.
Two. System file directory structure description
Directory |
Description |
/ |
The root directory of a virtual directory, which typically does not store files here |
/bin |
Binary directory, the GNU tool for user-level storage |
/boot |
Start directory, store startup files |
/dev |
Device directory, where the system creates the device node |
/etc |
System Configuration file Directory |
/home |
Home directory, where the system creates the user directory |
/lib |
Library directories, library files for systems and applications |
/media |
Media catalog, common mount points for removable media devices |
/mnt |
Mount directory, another common mount point for removable media devices |
/opt |
Optional directory, often used to store third-party packages and data files |
/proc |
Process directory, storing information about existing hardware and current processes |
/root |
Root User's home directory |
/sbin |
System binaries directory, storing many GNU administrator-level tools |
/run |
Run directory to store runtime data when the system is operating |
/srv |
Service catalog, files related to local services |
/sys |
The system directory, which holds the system hardware information related files |
/tmp |
Temporary directory where you can create delete temporary working files in this directory |
/usr |
User binaries directory, large number of user-level GNU tools and data file storage |
/var |
A variable directory for storing frequently changing files, such as log files |
Linux Programming 1 (File system path description, directory structure description)