The Linux directory structure is a different design from windows, which is easy for beginners to understand, here is a personal summary of some of the knowledge points, explained the Linux directory structure including file types and some important file subdirectories.
The top of the Linux file system is/, called the root of Linux, and all directories, files, and devices are in/below.
File type
Linux has four basic file system types: Normal files, directory files, continuous files, and special files. You can use the file command to identify.
Ordinary files: such as text files, C language source code, shell scripts, etc., you can use cat, less, more, vi and other to look at the content, with the MV to rename.
Catalog files: Include file names, subdirectory names, and their pointers. Directory files can be listed with LS
Linked files: Are those directory entries that point to an index node, when viewed with LS, the flag of the linked file starts with L, and the file then "-" points to the linked file
Special files: such as disks, terminals, printers, etc. are expressed in the file system, often placed in/etc directory. For example, floppy drive A is called/dev/fd0,/dev/had from the first hard drive.
/bin: The commands required to store the system, such as LS, CP, mkdir, and so on, functions and/usr/bin are similar, the files in this directory are executable, the common user can use the command.
/boot: This is the kernel of Linux and the file directory required by the boot system program, such as initrd.img files are located in this directory, the GRUB system Boot Manager is also located in this directory.
/dev: Device file storage directory, such as sound card, disk.
/etc: where the system configuration files are located, some server configuration files are also here, such as user account and password configuration files.
/home: The normal user directory is the default directory.
/lib: library file storage Directory
/lost+found: When the system crashes unexpectedly or the machine shuts down unexpectedly, some file fragments are placed here. When the system starts, the FSCK bus will check here and fix the corrupted file system.
/MNT: This directory is used to store the mounted directory of the mounted storage device. For example, there are directories such as CDROM. /etc/fatab
/OPT: Indicates an optional meaning, some packages are also installed here, that is, custom packages.
/proc: When the operating system is running, process information and kernel information are stored here. Proc is not a real file system, its definition can be found in/etc/fstab
/root:linux the root directory of the super-privileged user.
/sbin: Most of the commands involved in system Management, is the super-user root can point to the command repository, ordinary users do not have permission to execute the command under this directory, this directory and the/usr/sbin;/usr/local/sbin directory is similar. All directory sbin contains root permissions to perform.
/tmp: Temporary file directory, sometimes when the user runs the program, it will produce temporary files. This directory is similar to the/var/tmp directory.
/usr: This is a directory of system storage programs, such as commands, help files, and so on. When we install a Linux distribution that is officially provided by the package, it is mostly installed here. If a server configuration file is involved, the configuration file is installed in the/etc directory. The/usr directory includes design font directory/usr/share/fonts, help directory/usr/share/man or/usr/share/doc, normal user executable file directory/usr/bin or/usr/local/bin , super-user root executable command directory, such as/usr/sbin or/usr/local/sbin, as well as the program's header file storage directory/usr/include
/var: The contents of this directory are constantly changing, and/Var has/var/log which is used to store the system log directory. /var/lib is used to store some library files, such as MySQL.
/media: This directory is empty and is for mounting.
/selinux: I don't know how to use it!!!
/SRV: Some services require access to the files stored in this
/sys: Core file of the system
/cdrom: Optical Drive
Some important sub-directories:
/ETC/INIT.D: This directory is used to store the system or server scripts that are launched in Systems v mode.
/ETC/X11: This is the location where the X-window related configuration files are stored.
/usr/bin: This directory is a directory of executable programs, the normal user has permission to execute, when we install a program from the system's own package, most of his executable files will be placed in this directory.
/usr/sbin: This directory is also a directory of executable programs, but most of the commands designed to manage the system can only be executed with root privileges.
/usr/local: This directory is generally used to store the user's self-compiled installation software storage directory, usually through the source package installed software, if not specifically designated installation directory, is generally installed in this directory.
/usr/share: The place where the system is shared.
/USR/SRC: The directory where the kernel source code is stored.
This is a collection of more comprehensive information about the structure of the Linux directory.
Detailed analysis of the Linux directory structure