Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Directory Description catalog description of 2.1Linux (summary)

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Linux Directory Description

binaries Essential command binaries Binary program for all basic commands available to the user

bootStatic files of the boot loader, kernel initramfs (initrd), grub, etc.

devDevice files There are two types of devices that store special files or device files: block devices (random devices) and character devices (linear devices).

hard disk, hard disk partition, usb flash drive/dev/sd[a-p] digital 25-pin printer/dev/lp[0-2]usb interface printer/dev/usb/lp[0-15] floppy disk/dev/fd[0-7]VirtI/O interface/dev/vd[a-p] mouse/dev/input/mouse[0-15](generic) CDROM/DVDROM /dev/scd[0 - 1]/dev/sr[0 - 1]/dev/cdrom tape drive/dev/ht0 IDE interface/dev/sr0 SATA/SCSI interface/dev/tape current tape

etc Host-specific system configuration system program configuration file, cannot be binary program

home The centralized location of the home directory of an ordinary user. Generally, the home directory of each user defaults to a subdirectory with the same name as the user under this directory,/home/$USER

root Home directory for the root user (optional) Administrator's home directory, optional. Should be logged in as a regular user.

lib Essential shared libraries and kernel modules Basic shared libraries and kernel modules provide shared libraries for system startup or with applications on the file system (/bin,/sbin, etc.), and kernel modules for the kernel

libc.so. the dynamically-linked C library ld the execution time linker/loader runtime linker/loader/lib: ** Required directories or soft links, loadable kernel modules lib64: 64-bit system special path to store 64-bit shared libraries, 32-bit libraries under lib

media: Mount point for removable media Mount point for removable, portable devices

mnt: Mount point for mounting a filesystem temporarily

opt: Add-on application software packages Installation location of add-on application software packages, optional

sbin: Essential system binaries

srv: Data for services provided by this system

tmp: Temporary files directory where temporary files generated by programs are stored and where all users can write to them.

usr: Secondary hierarchy usr hierarchy the second most important file system

bin, sbinlib, lib64include: c header file share: command manual page and built-in documentation etc. architecture-specific file storage localX11 R6: x windows system installation directory games:src: source file storage localusr/local hierarchy system administrator installs applications; usually used to install third-party programs

var contains variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files. Store data that changes frequently

cache Application cache datalibVariable state informationlocal Variable data for /usr/locallock Lock files log files and directories log files opt Variable data for /optrun Data relevant to running processes spool Application spool datatmp Temporary files preserved between system reboots

proc memory-based virtual file system, storing kernel and process-related files, mostly kernel parameters, such as net.ipv4.ip_forward, virtual net/ipv4/ip_forward , full path/proc/sys/net/ipv4/ip_forward

sys memory-based sysfs virtual file system provides a better way to access kernel data than proc, mainly to manage Linux devices and provide a unified model interface

2 Contents contained in subdirectories under/sys

devices This is the kernel's hierarchical representation model of all devices in the system, and is also the most important directory structure for the/sys file system management device. The following will further analyze its internal structure;

dev maintains a symbolic link file that links the primary and secondary numbers of character devices and block devices (major:minor) to real devices (under/sys/devices), which was first introduced in kernel 2.6.26;

bus This is a directory structure in which kernel devices are placed hierarchically by bus type. All devices in devices are connected under a certain bus. Under each specific bus here, you can find the symbolic link of each specific device. It is also part of the Linux unified device model.

class This is a device model classified by device function, such that all input devices of the system appear under/sys/class/input, regardless of the bus they are connected to the system. It is also part of the Linux Unified Device Model;

block Here is where all the current block devices in the system are located. It is more appropriate to place them under/sys/class according to their functions, but they have always existed in/sys/block due to historical legacy factors, but they have been marked as obsolete since 2.6.22. This directory only exists when compiling under CONFIG_SYSFS_DEPRECATED configuration, and has been officially moved to/sys/class/block in the 2.6.26 kernel. The old interface/sys/block remains for backward compatibility, but its contents have become symbolic link files pointing to their real devices in/sys/devices/;

firmware Here is the interface to user space of the system firmware loading mechanism. There is a set of API dedicated to firmware loading. In Appendix LDD3, there is a more detailed introduction to the kernel support firmware loading mechanism.

fs is designed to describe all file systems in the system, including the file system itself and mounted points stored by file system classification. However, only a few file systems such as fuse and gfs2 support sysfs interface at present, and some traditional virtual file system (VFS) hierarchical control parameters are still in sysctl (/proc/sys/fs) interface;

kernel Here is the location of all kernel tunable parameters. Currently, only uevent_helper, kexec_loaded, mm, and the new slab allocator are using it. Other kernel tunable parameters are still located in the sysctl (/proc/sys/kernel) interface.

module Here is information about all modules in the system, whether they are compiled inline into kernel image files (vmlinuz) or compiled as external modules (ko files), which may appear in/sys/module: Compiled as an external module (ko file), the corresponding/sys/module//will appear after loading, and some property files and property directories will appear under this directory to represent some information of this external module, such as version number, loading status, provided drivers, etc.; modules compiled inline will only appear corresponding to/sys/module/if it has module parameters with non-zero attributes. The available parameters of these modules will appear in/sys/modules//parameters/, such as/sys/module/printk/parameters/time. This read-write parameter controls whether the inline module printk adds a time prefix when printing kernel messages; all inline module parameters can also be defined by ".= The form "is written on kernel startup parameters, such as adding the parameter"printk.time=1"when starting the kernel, which has the same effect as writing 1 to"/sys/module/printk/parameters/time"; inline modules without non-zero attribute parameters will not appear here.

power Here is the power option in the system. There are several property files in this directory that can be used to control the power status of the whole machine, such as writing control commands to shut down and restart the machine.

slab (corresponding to the 2.6.23 kernel, moved to/sys/kernel/slab after 2.6.24) Starting with 2.6.23, the implementation of the SLAB memory allocator can be selected, and the new SLUB (Unqueued Slab Allocator) is set to the default value; if this option is compiled,/sys/slab appears under/sys, with adjustable parameters for each kmem_cache structure. Corresponding to the old SLAB memory allocator's/proc/slabinfo dynamic adjustment interface, the new/sys/kernel/slab/interface has clearer information and adjustable items.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report