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

What is the directory structure of Linux system?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Today, I will talk to you about the directory structure of the Linux system, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

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 Binaries (binaries), 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:

Etc is an acronym for Etcetera (etc.). This directory is used to store all configuration files and subdirectories needed for system administration.

/ home:

The user's home directory. In Linux, each user has his own directory, which is usually named after the user's account, such as alice, bob and eve in the figure above.

/ lib:

Lib is an acronym for Library (library). This directory stores the system's most basic dynamic link shared library, which is 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:

Opt is an acronym for optional (optional), which 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:

Proc is the abbreviation of Processes (process). / proc is a pseudo file system (that is, virtual file system), which stores a series of special files of the current kernel running state. This directory is a virtual directory, which is the 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, an abbreviation for Superuser Binaries (superuser binaries), where the system administrator uses the system management program.

/ 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:

Tmp is an abbreviation for temporary. This directory is used to store temporary files.

/ usr:

Usr is an acronym for unix shared resources (shared Resources), which 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:

Var is an acronym for variable (variable). 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.

After reading the above, do you have any further understanding of the directory structure of the Linux system? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

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

Development

Wechat

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

12
Report