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 root directory of linux

2025-01-16 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 "what is the root directory of linux". In the operation of actual cases, many people will encounter such a dilemma, 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!

In linux, the root directory "/" is located at the top level of the file system directory structure, is the top-most directory, all files and directories are placed under the root directory "/"; under the root directory "/ bin", "/ home", "/ usr" and other subdirectories.

The operating environment of this tutorial: CentOS 6 system, Dell G3 computer.

Root directory of the Linux system (/)

The file system of Linux and UNIX is a hierarchical file structure with "/" as the root, so "/" is called the root directory.

All files and directories are placed under the root directory "/". There are subdirectories such as / bin,/home,/usr under the root directory.

The FHS standard recommends that the partition of the root directory "/" should be as small as possible, and the software installed by the application should not be placed in the same partition as the root directory, so as to keep the root directory as small as possible.

Linux's philosophical thought

1. Everything is a document.

two。 Composed of small, single-purpose Mini Program; combined Mini Program to accomplish complex tasks

3. Try to avoid capturing the user interface

4. Save the configuration information of the program through a configuration file, which is usually a plain text file

Root $ls / bin dev home lib64 mnt proc run srv usrboot etc lib media opt root sbin sys tmp var

(1) bin

Binary binary

Storage directories of executable program files corresponding to many "instructions"

Ls, pwd, init, etc.

(2) boot

It mainly places the files used by the boot machine, including the Linux core files, the boot menu and the required configuration files, and so on. The common file name of Linux kernel is: vmlinuz, if you are using the boot manager grub, the directory / boot/grub/ will still exist!

(3) dev

On Linux systems, any devices and peripherals exist in this directory in the form of files. As long as you access a file in this directory, you are accessing a device. More important files are / dev/null, / dev/zero, / dev/tty, / dev/lp*, / dev/hd*, / dev/sd* and so on.

(4) etc

Almost all the main configuration files of the system are placed in this directory, such as the account password file of personnel, the startup file of various services, and so on. Generally speaking, the properties of the files under this directory are accessible to the general user, but only root has the right to modify them. FHS recommends that you do not place executable files (binary) in this directory. The more important files are: / etc/inittab, / etc/init.d/, / etc/modprobe.conf, / etc/X11/, / etc/fstab, / etc/sysconfig/ and so on. In addition, the important catalogs are:

/ etc/init.d/: the default startup script for all services is placed here, for example, to start or disable iptables: "/ etc/init.d/iptables start", "/ etc/init.d/iptables stop"

/ etc/xinetd.d/: this is the so-called profile directory of services managed by super daemon.

/ etc/X11/: all kinds of configuration files related to X Window are here, especially the two X Server profiles, xorg.conf or XF86Config.

(5) home

This is the default user home directory (home directory) for the system. When you add a general user account, the default user home directory will be regulated here. More importantly, home catalogs have two code names:

~: represents the home directory of the current user, while ~ guest: represents the home directory with the user name guest!

(6) lib

There are a lot of libraries in the system, and / lib places libraries that will be used when booting, and libraries that will be called by instructions under / bin or / sbin. What is a function library? You can think of it as a "plug-in". Some instructions must have these "plug-ins" in order to successfully complete the execution of the program. Particularly important is the / lib/modules/ directory, because it places core-related modules (drivers)!

(7) lib64

(8) media

Media is the English word for "media". As the name implies, what is placed under this / media is a removable device! Including floppy disks, CD-ROMs, DVD and other devices are temporarily mounted here. Common file names are: / media/floppy, / media/cdrom, and so on.

(9) mnt

If you want to mount some additional devices temporarily, it is generally recommended that you put them in this directory. In the early days, this directory was used for the same purpose as / media! It's just that with / media, this directory is used for temporary mount.

(10) opt

This is a directory for third-party collaboration software. What is third-party collaboration software? For example, KDE, the desktop management system, is a stand-alone project, but it can be installed in Linux, so KDE's software is recommended to be placed in this directory. In addition, if you want to install additional software on your own (not provided by the original distribution), you can also install your software here. However, in previous Linux systems, we were used to placing it in the / usr/local directory!

(11) proc

The directory itself is a "virtual file system (virtual filesystem)"! The data he places is in memory, such as the core of the system, process (is it a process?), the status of peripheral devices and network status, and so on. Because the data in this directory is in memory (memory), it does not take up any hard disk space! More important files (directories) such as / proc/cpuinfo, / proc/dma, / proc/interrupts, / proc/ioports, / proc/net/*, etc. Ha ha, is it virtual memory [guest]?

(12) root

Home directory of the system administrator (root). The reason for putting it here is that if you enter single maintenance mode and mount only the root directory, it will be able to have root's home directory, so we will want root's home directory to be placed in the same partition as the root directory.

(13) run

The contents are needed when the system is running and cannot be deleted casually. But it should be abandoned when it is restarted. Regenerate the next time the system runs.

(14) sbin

Linux has a lot of instructions to set the system environment, these instructions only root can use to "set" the system, other users can only be used to "query" at most. Put under / sbin is needed during the boot process, including the instructions needed to boot, repair, and restore the system. As for some server software programs, they are generally placed in / usr/sbin/. As for the system execution file (system binary) generated by the local self-installed software, it is placed in / usr/local/sbin/. Common instructions include: fdisk, fsck, ifconfig, init, mkfs and so on.

(15) srv

Srv can be regarded as an acronym for "service". It is the data directory that some network services need to access after they are started. Common services such as WWW, FTP, etc. For example, the web data needed by the WWW server can be placed in / srv/www/. Hehe, it seems that the code we write should be put here.

(16) sys

This directory is actually very similar to / proc, which is also a virtual file system that records information related to the core. Including currently loaded core modules and core detected hardware device information and so on. This directory also does not occupy the capacity of the hard disk!

(17) tmp

This is the place for the general user or the running program to temporarily place the file. This directory is accessible to anyone, so you need to clean it up regularly. Of course, important information can not be placed in this directory! Because FHS even suggests that you should delete all the data under / tmp when you turn it on!

(18) usr

/ usr is the core of the system and contains all the shared files. It is one of the most important directories in the unix system, covering binaries, various documents, various header files, x, and various library files, as well as many programs, such as ftp,telnet, etc.

(19) var

/ var/log, log file

/ var/run,pid file

/ var/mail, the location where the user's mail is stored

This is the end of the content of "what is the root directory of linux". 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