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

The structure of Linux directory tree

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

Share

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

This article introduces the relevant knowledge of "the structure of Linux directory tree". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The main parts of the directory tree are root (/), / USR, / var, / home, and so on. Here is a typical linux directory structure as follows:

/ root directory

/ bin stores the necessary commands

/ boot stores the kernel and the files needed for startup, etc.

/ dev stores device files

/ etc stores the configuration files of the system

The home directory of / home user files, where user data is stored

/ lib stores the necessary runtime

/ mnt holds a temporary mapping file system, and we often mount floppy and CD drives in the floppy and CDRom subdirectories here.

/ proc stores storage process and system information

/ root superuser's home directory

/ sbin storage system management program

/ tmp directory where temporary files are stored

/ usr contains applications that generally do not need to be modified, command program files, libraries, manuals, and other documents.

/ var contains frequently changed files generated by the system, such as printers, mail, news, etc., log files, formatted man pages, data files for some applications, and so on. It is recommended to put it in a separate partition. [separator]

A typical / usr directory is as follows:

/ X11R6 stores X Window system

/ bin stores additional user programs

/ dict stores dictionaries

/ doc stores additional documents

/ etc stores the settings file

/ games stores games and teaching files

/ include stores the header files of C development tools

/ info stores GNU information files

/ lib repository file

/ local stores locally generated increased applications

/ man stores online help files

/ sbin stores additional hypervisors

/ share stores structurally independent data

/ src stores the source code of the program

Since the files in / usr are not computer-specific and will not be modified in normal use, this directory (file system) can be shared over the network, so that when the administrator installs the new software, all computers that share the file system can use the new software.

Linux inherits the clear structure of unix operating system. The file structure under linux is very organized. However, the above advantages can only be realized if you are quite familiar with linux. Now, the bug will briefly introduce the directory structure under linux.

/ vmlinuz

We already know that every linux has a vmlinuz, and we add modules to this kernel that can perform a variety of specific functions, each module reflected in a variety of different directories in the linux. Of course, the directories of different distributions vary slightly, but the main structure is the same. We also need to combine the functional modules of linux with various applications so that your linux system can serve you. Stored in the / vmlinuz directory is the kernel of the system. Remember when we were configuring Lilo, we mentioned this kernel?

/ bin

Obviously, bin is an acronym for binary. In the general system, you can find the commands commonly used by linux in this directory. In some versions you will also find some of the same directories as the root directory.

/ boot

All the programs stored in this directory are the programs to be used when the system starts up. We will use some of the information here when booting linux using lilo.

/ dev

Dev is an acronym for device. This directory is very important to all users. Because all the external devices used in linux systems are included in this directory. But this is not the driver of the external device. This is different from our commonly used windows and dos operating systems. It is actually a port to access these external devices. We can easily access these external devices, and there is no difference between accessing a file or a directory. For example, we type: cd / dev/cdrom into the system and we can see the files in the CD-ROM drive. By the same token, we can look at the mouse-related files by typing: cd / dev/mouse. In this directory, there is a null device that does not make any sense in itself. If you write files or contents to this directory, they will never return.

/ cdrom

This directory was empty when you first installed the system. You can hang the optical drive file system in this directory. For example: mount / dev/cdrom / cdrom

/ etc

Etc is one of the most important directories in linux systems. Various configuration files and subdirectories used in system management are stored in this directory. The network configuration files, file systems, x system configuration files, device configuration information, settings user information, etc. that we are going to use are all in this directory. In the future, the bug will explain the contents of this directory in detail.

/ sbin

This directory is used to store the system administrator's system management program.

/ home

If we create a user with a user name of "xx", then there is a corresponding / home/xx path under the / home directory to hold the user's home directory.

/ lib

Lib is the abbreviation of library. This directory is used to store system dynamic connection shared libraries. Almost all applications use the shared libraries in this directory. Therefore, do not easily do anything to this directory, once there is a problem, your system will not work, then you do not say that the bug did not warn you.

/ lost+found

This directory is empty in most cases. But if you are at work when there is a sudden power outage, or if your phone is not turned off in a normal way, when you restart the machine, some files will not be found where they should be stored. For these files, the system puts them in this directory. It's like providing a temporary shelter for the homeless.

/ mnt

This directory is also empty under normal circumstances. You can temporarily hang other file systems in this directory.

/ proc

You can get system information in this directory. This information is generated by the system itself in memory.

/ root

If you are logged in as a superuser, this is the superuser's home directory.

/ tmp

Used to store temporary files generated during the execution of different programs.

/ usr

This is the directory that takes up the most hard disk space in the linux system. Many of the user's applications and files are stored in this directory.

This is the end of the introduction to "the structure of the Linux Directory Tree". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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