What is the significance of Linux directory structure

PHPz
Release: 2023-06-01 16:55:06
forward
1322 people have browsed it

/

root --- Some core files used when starting linux. Such as operating system kernel, boot program grub, etc.
home --- Stores personal files of ordinary users
ftp --- All user services
httpd
samba
user1
user2
bin --- Required when the system starts Executable files (binary)
sbin --- Directory of executable programs, but most of them store commands related to system management. Only root privileges can be executed
proc --- Virtual, there is a Linux kernel image; saves all kernel parameters and system configuration information
1 --- Process number
usr --- User directory, stores user-level File
bin --- Commands used by almost all users, and also exists with /bin, /usr/local/bin
sbin --- System administrator commands, related to users, for example, most server programs
include --- Directory for storing c/c header files
lib --- Fixed program data
local --- Locally installed software storage location
man --- Manually generated directory
info --- Information document
doc --- Different package document information
tmp
x11r6 --- This directory is used to save all files required to run x-window. This directory also contains configuration files and binaries for running the gui.
x386  --- System files with the same functions as x11r6, x11 release 5
boot --- Files required by the boot loader, images required by the system are saved here
lib --- Root file system directory Common libraries for downloading programs and core modules
modules --- loadable modules, required modules for restarting after a system crash
dev --- device file directory
etc --- configuration file
skel - -- The home directory is established, and the directory is initialized
sysconfig --- Network, time, keyboard and other configuration directories
var
file
lib --- The files in this directory will be stored when the system is running Change
local --- program data installed in /usr/local, change
lock --- file uses specific peripherals or files, lock them, and other files are temporarily inaccessible
log - -- Record log
run --- System running legal information
spool --- Spool directory for printers, emails, proxy servers, etc.
tmp
catman --- Cache directory
mnt --- A temporary place to mount the file system. Under normal circumstances, this directory is empty. When we are going to mount the partition, we create a directory in this directory, and then mount the device we want to access in this directory, so that we can access the files.
tmp --- Temporary file directory, temporary files after system startup are stored in /var/tmp
lost found --- Files recovered when the file system is repaired

For each directory suggestion:

/: Root directory. Generally, only directories are stored in the root directory, not files. /etc, /bin, /dev, /lib, /sbin should be placed in the same partition as the root directory.
/bin:/usr/bin: Directory of executable binary files, such as commonly used commands ls, tar, mv, cat, etc.
/boot: Place some files used when the Linux system starts. /boot/vmlinuz is the Linux kernel file, and /boot/gurb. It is recommended to partition separately, the partition size is 100m
/dev: stores device files under the Linux system, accessing a file in this directory is equivalent to accessing a device, commonly used is to mount an optical drive mount /dev/cdrom /mnt.
/etc: The directory where system configuration files are stored. It is not recommended to store executable files and important configuration files in this directory. There are /etc/inittab, /etc/fstab, /etc/init.d, /etc/x11, /etc/sysconfig, and /etc/xinetd.d. Remember to back up the configuration files before modifying them.
Note: /etc/x11 stores settings related to x windows.
/home: The system's default user home directory. When adding a new user account, the user's home directory is stored in this directory. ~ represents the current user's home directory, and ~test represents the home directory of user test. It is recommended to partition separately and set up a larger disk space to facilitate users to store data.
/lib:/usr/lib:/usr/local/lib: The directory of the function library used by the system. During the execution of the program, when the program needs to call some additional parameters, it requires the assistance of the function library, which is more important. The directory is /lib/modules.
/lost fount: When a system exception occurs and an error occurs, some lost fragments will be placed in this directory. Usually this directory will automatically appear in the device directory. If the hard disk is loaded in /disk, the directory /disk/lost found
/mnt:/media will be automatically generated in this directory: the default mounting point of the CD. Usually the CD is mounted under /mnt/cdrom, but not necessarily , you can choose any location to mount.
/opt: The directory where additional software is installed for the host. For example: the fedora community development software used by fc4. If you want to install the new kde desktop software by yourself, you can install the software in this directory. In previous Linux systems, it was customary to place it in the /usr/local directory
/proc: The data in this directory are all in the memory, such as the system core, external devices, and network status. Since the data are all stored in the memory, they are not Occupying disk space, the more important directories include /proc/cpuinfo, /proc/interrupts, /proc/dma, /proc/ioports, /proc/net/*, etc.
/root: the home directory of the system administrator root, The first partition that the system starts up is /, so it is best to place /root and / under the same partition.
/sbin:/usr/sbin:/usr/local/sbin: Place executable commands used by system administrators, such as fdisk, shutdown, mount, etc. Different from /bin, these directories are commands used by the system administrator root. General users can only "view" them but cannot set or use them.
/tmp: The directory where general users or executing programs temporarily store files. Anyone can access it. Important data cannot be placed in this directory.
/srv: The data directory that needs to be accessed after the service is started. For example, the web page data that the www service needs to access is stored in /srv/www.
/usr: Application storage directory, /usr/bin stores applications, /usr/share stores shared data, /usr/lib stores some function library files that cannot be run directly, but are necessary for the operation of many programs. /usr/local: Stores software upgrade packages. /usr/share/doc: System description file storage directory. /usr/share/man: The directory where program description files are stored. When using man ls, the contents of /usr/share/man/man1/ls.1.gz will be queried. It is recommended to partition it separately and set a larger disk space.
/var: Place files that change frequently during system execution, such as log files/var/log that change at any time, /var/log/message: Directory where all login files are stored, /var/spool/mail: Mail storage directory, /var/run: After the program or service is started, its pid is stored in this directory. It is recommended to partition separately and set a larger disk space.

The above is the detailed content of What is the significance of Linux directory structure. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!