Getting Started with Linux - File System Directory Structure

The organization of the file system is different for different operating systems. The current two major operating systems, Windows and Linux, have great differences in the organization of the file system. The file system of windows is based on the drive letter, so the files are mounted on the partition. On the contrary, the file system of linux and unix is ​​based on the file, everything is a file, and the partition is mounted in the directory.

In Linux and Unix operating systems, all files and directories are organized into an inverted tree structure starting with the root directory node (/), which constitutes a huge "file tree". For directories, there are two special types of directories:

  •  . : Represents the current directory, or ./ can be used;
  •  .. : Represents the upper level directory, or ../ to represent.

If a directory or file name starts with a dot., it means that the directory or file is a hidden directory or file, that is, the directory or file is not displayed when it is searched by default.

You can use the option -a of the ls command to view hidden directories and files

The Linux file tree is as follows:

Below are some explanations of these directories

/root Home directory for superuser login

/home The default user working root directory of the linux system. For each user, there will be its own home directory. Generally, the account name is used as the home directory name. For example, the home directory of user gcc is /home/gcc

/bin /esr/bin Abbreviation for binary, which stores the execution files of common operation commands in Linux, such as ls, rm, touch, cat, etc.

/boot The programs needed to start the operating system, including some core files and image files

/dev stores device files under linux. Accessing devices in linux is the same as accessing files. Which file in this directory is accessed is which device interface is accessed.

/etc system configuration files, including network configuration files (netinterfaces NetManager), file systems, X system configuration files, device configuration information, setting user information, etc.

/lib /usr/lib /usr/local/lib stores the most basic dynamic link shared libraries of the system, similar to the DLL files in windows, and almost all applications need to use these shared libraries.

/media Mounting point of CD-ROM and floppy drive Linux system will automatically identify some devices, such as U disk, CD-ROM, etc. After identification, linux will mount the identified device to this directory.

/mnt CD-ROM, floppy, hard disk mount point, you can also temporarily mount other file systems to this directory

/proc places some information needed by the system core and executing the program. The data in this directory is in the memory, such as the system core, external devices, and network status. Since the data is stored in the memory, it does not occupy disk space.

/sbin System management program commonly used by superuser administrators

/usr User applications and files are stored here, similar to program files under Windows

/sys This is a big change from 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 filesystem 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.

/var Log information of many important services is stored here

/usr/src The default directory for the kernel source code

/usr/sbin The more advanced management programs and system daemons used by the superuser

 

/bin, /sbin, /usr/bin, /usr/sbin: This is the default directory where the executable files are placed. For example, ls is in the /bin/ls directory.

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

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325459430&siteId=291194637