Home Operation and Maintenance Linux Operation and Maintenance What is the significance of Linux directory structure

What is the significance of Linux directory structure

Jun 01, 2023 pm 04:55 PM
linux

/

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1269
29
C# Tutorial
1249
24
Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

vscode Previous Next Shortcut Key vscode Previous Next Shortcut Key Apr 15, 2025 pm 10:51 PM

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

How to run sublime after writing the code How to run sublime after writing the code Apr 16, 2025 am 08:51 AM

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

What is the main purpose of Linux? What is the main purpose of Linux? Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

git software installation git software installation Apr 17, 2025 am 11:57 AM

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

See all articles