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

How to interpret the directory structure of Linux system

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article shows you how to interpret the directory structure of the Linux system, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

The Linux kernel was originally written by Finn Linus Torvalds out of his own hobby when he was a student at the University of Helsinki. Linux is a free-to-use and free-spread Unix-like operating system. It is a multi-user, multi-task, multi-threaded and multi-CPU operating system based on POSIX and UNIX. Linux can run major UNIX tools, applications, and network protocols. It supports 32 bit and 64 bit hardware. Linux inherits the design idea of Unix with network as the core, and is a multi-user network operating system with stable performance.

After logging in to the system, enter the command under the current command window:

Ls /

You will see the following figure:

Tree directory structure:

Here is an explanation of these catalogs:

/ bin:

Bin is an acronym for Binary, and this directory holds the most frequently used commands.

/ boot:

Here are some of the core files used to start Linux, including some connection files and image files.

/ dev:

Dev is the abbreviation of Device (device). In this directory, the external devices of Linux are stored. The way of accessing devices in Linux is the same as the way of accessing files.

/ etc:

This directory is used to store all the configuration files and subdirectories needed for system management.

/ home:

The user's home directory. In Linux, each user has his own directory, which is usually named after the user's account.

/ lib:

This directory stores the system's most basic dynamic link sharing library, which works similar to the DLL file in Windows. Almost all applications need to use these shared libraries.

/ lost+found:

This directory is usually empty, and when the system shuts down illegally, some files are stored here.

/ media:

The linux system will automatically identify some devices, such as USB drives, optical drives, and so on. When identified, linux will mount the identified devices to this directory.

/ mnt:

The system provides this directory to allow users to mount other file systems temporarily. We can mount the CD-ROM drive on / mnt/, and then enter the directory to view the contents of the CD-ROM drive.

/ opt:

This is the directory where additional software is installed for the host. For example, if you install an ORACLE database, you can put it in this directory. The default is empty.

/ proc:

This directory is a virtual directory, it is a mapping of system memory, we can access this directory directly to get system information.

The contents of this directory are not on the hard disk but in memory. We can also modify some files directly. For example, you can use the following command to block the ping command of the host, so that others cannot ping your machine:

Echo 1 > / proc/sys/net/ipv4/icmp_echo_ignore_all

/ root:

This directory is the system administrator, also known as the super-privileged user home directory.

/ sbin:

S means Super User, and here is the system management program used by the system administrator.

/ selinux:

This directory is unique to Redhat/ CentOS, Selinux is a security mechanism, similar to windows's firewall, but this mechanism is more complex, this directory is to store selinux-related files.

/ srv:

This directory stores some data that needs to be extracted after the service is started.

/ sys:

This is a big change in the linux2.6 kernel. A new filesystem sysfs in the 2.6 kernel is installed in this directory.

The sysfs file system integrates the following three types of file system information: the proc file system for process information, the devfs file system for devices, and the devpts file system for pseudo-terminals.

The file system is an intuitive reflection of the kernel device tree.

When a kernel object is created, the corresponding files and directories are also created in the kernel object subsystem.

/ tmp:

This directory is used to store some temporary files.

/ usr:

This is a very important directory where many of your applications and files are placed, similar to the program files directory under windows.

/ usr/bin:

The application used by the system user.

/ usr/sbin:

More advanced hypervisors and system daemons used by superusers.

/ usr/src:

The default placement directory for kernel source code.

/ var:

This directory contains things that are constantly expanding, and we are used to putting directories that are often modified in this directory. Including various log files.

/ run:

Is a temporary file system that stores information since the system was started. When the system restarts, the files in this directory should be deleted or erased. If you have a / var/run directory on your system, you should make it point to run.

In the Linux system, there are several directories are more important, usually need to be careful not to delete or change the internal files at will.

/ etc: as mentioned above, this is the configuration file in the system, and if you change a file in this directory, the system may not be able to boot.

/ bin, / sbin, / usr/bin, / usr/sbin: this is the directory where the system preset execution 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 (except root users), and / sbin, / usr/sbin are instructions for root.

/ var: this is a very important directory, there are many programs running on the system, then each program will have corresponding logs generated, and these logs will be recorded in this directory, specifically in the / var/log directory, and the default placement of mail is also here.

The above content is how to interpret the directory structure of Linux system. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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