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

Standard directory structure of linux

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

Share

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

This article mainly explains the "linux standard directory structure", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "linux standard directory structure" bar!

Linux standard directory structure:

/

Root-some core files used when starting Linux. Such as operating system kernel, bootstrap Grub and so on.

Home-storing the personal files of ordinary users

Ftp-all services for users

Httpd

Samba

User1

User2

Bin-the execution file required for system startup (binary)

Sbin-the directory of executable programs, but most of them hold commands related to system management. Only root permission can execute

Proc-virtual, there is a linux kernel image; save all kernel parameters and system configuration information

1-process number

Usr-user directory to store user-level files

Bin-almost all commands used by users, plus / bin,/usr/local/bin

Sbin-system administrator commands related to users, for example, most server programs

Include-the directory where the header files are stored in Candlespace +.

Lib-fixed program data

Local-location of locally installed software

Man-manually generated directories

Info-Information document

Doc-document information of different packages

Tmp

X11R6-this directory is used to hold all the files needed to run X-Window. This directory also contains configuration files and binaries for running GUI.

X386-system files with the same functions as X11R6 and X11 release 5

Boot-the files required by the boot loader, and the pictures required by the system are saved here

Lib-the common library of programs and core modules in the root file system directory

Modules-loadable module, restart the required module after the system crash

Dev-device file directory

Etc-configuration file

Skel-home directory is established, and it is initialized

Sysconfig-Network, time, keyboard and other configuration directory

Var

File

Lib-the files in this directory will change when the system is running

Local-the program data installed in / usr/local, changed

Lock-files are locked using specific peripherals or files, and other files are temporarily inaccessible

Log-keep a log

Run-legal information of system operation

Spool-printers, mail, proxy servers and other spooling directories

Tmp

Catman-cache directory

Mnt-A place where the file system is temporarily mounted. Normally, this directory is empty, but when we are about to mount the partition, create a directory in this directory, and then mount the devices we are going to access to this directory, so that we can access the files.

Tmp-temporary files directory, temporary files after system startup are stored in / var/tmp

Lost+found-Files restored when the file system is repaired

/: root directory. Generally, only directories are stored in the root directory. Do not store files. / etc, / bin, / dev, / lib, / sbin should be placed in a partition with the root directory.

/ bin:/usr/bin: directory for executable binaries, such as the commonly used commands ls, tar, mv, cat, etc.

/ boot: place some files that are used when the linux system starts. / boot/vmlinuz is the kernel file of linux, and / boot/gurb. Separate partitions are recommended, with a partition size of 100m.

/ dev: store the device files under the linux system, and accessing a file in this directory is equivalent to accessing a device. It is common to mount the optical drive mount / dev/cdrom / mnt.

/ etc: the directory where the system configuration files are stored. It is not recommended to store executable files in this directory. Important configuration files are / etc/inittab, / etc/fstab, / etc/init.d, / etc/X11, / etc/sysconfig, / etc/xinetd.d. Remember to back up before modifying the configuration files.

Note: / etc/X11 stores settings related to x windows.

/ home: the default user home directory of the system. When you add a user account, the user's home directory is stored in this directory. ~ represents the current user's home directory, and ~ test represents the user's test home directory. It is recommended to partition separately and set up a larger disk space to facilitate users to store data.

/ lib:/usr/lib:/usr/local/lib: the directory of the function library used by the system. When the program needs to call some additional parameters during execution, it needs the assistance of the function library. The more important directory is / lib/modules.

/ lost+fount: when an error occurs in a system exception, some missing fragments will be placed in this directory, which usually automatically appears in the device directory. If the hard disk is loaded in / disk, the directory / disk/lost+found will be automatically generated in this directory.

/ mnt:/media: CD is mounted by default. Usually, CD is mounted under / mnt/cdrom, but not necessarily. You can choose any location to mount.

/ opt: the directory where additional software is installed for the host. Such as: FC4 uses Fedora community development software, if you want to install new KDE desktop software, you can install the software in this directory. In previous Linux systems, it was used to being placed in the / usr/local directory

/ proc: the data of this directory is all in memory, such as system core, external devices, network status. Because the data is stored in memory, it does not take up disk space. The more important directories are / proc/cpuinfo, / proc/interrupts, / proc/dma, / proc/ioports, / proc/net/* and so on.

/ root: the home directory of the system administrator root, and the first startup partition of the system is /, so it's best to put / root and / under one partition.

/ sbin:/usr/sbin:/usr/local/sbin: place executable commands used by system administrators, such as fdisk, shutdown, mount, etc.

Unlike / bin, these directories are commands for the system administrator root, which the average user can only "view" but cannot set and use.

/ tmp: the directory where files are temporarily stored by ordinary users or executing programs, which can be accessed by anyone. Important data cannot be placed in this directory.

/ srv: the data directory that needs to be accessed after the service is started, such as the web page data that the www service needs to access, is stored in / srv/www

/ usr: application storage directory, / usr/bin storage application, / usr/share storage shared data, / usr/lib storage can not be directly run, but some of the necessary library files for the operation of many programs. / usr/local: store the software upgrade package. / usr/share/doc: the directory where the system documentation is stored. / usr/share/man: the directory where the program description files are stored. When using man ls, the contents of / usr/share/man/man1/ls.1.gz will be queried. It is recommended to partition separately and set a larger disk space.

/ var: place files that change frequently during the execution of the system, such as log files that change at any time / var/log,/var/log/message: all login files are stored in the directory, / var/spool/mail: the directory where mail is stored, / var/run: after the program or service starts, its PID is stored in this directory. It is recommended to partition separately and set a larger disk space.

/ 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. Command redirection includes: ls-al 1 > list.right 2 > / dev/null

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

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

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

Supplementary information:

/ root directory

Storage of the most important executable files in bin system, commands commonly used in Linux, commands commonly used by general users and superusers, such as ls,su,mout

Boot stores kernel files and other information files when the system starts.

All the files in the dev directory are special files (device files), and Linux treats all peripherals as one file. That is, the operation of the user to the file representing the peripheral represents the operation of the peripheral. Therefore, / dev is very important to the system. For example, to format a floppy disk in the EXT2 file system, do this: mke2fs / dev/fd0

Etc this is the main location where configuration files are stored within the system. Generally, configuration files that are closely related to the system are placed in this directory. In other words, the configuration of the system is mainly to modify the files in this directory. In this directory, there are mostly text files, such as inittab,lilo.conf

Home this is the main directory of the default home directory of ordinary users, that is, the home directory of ordinary users is set to: / home/ [userid] directory

Initrd is used to mount RAM device files when starting in RAM Disk mode

Lib stores the linked library files of the system. Without this directory, the system will not function properly.

Use when restoring an lost+found file system

Misc alternate directory

Mnt this is the installation directory where the system provides additional file systems for installation, such as mounting floppy drives, optical drives, etc. Its main purpose is not to disturb the original catalogue system structure.

Opt is used to install files or programs for all users

The files in the proc directory are not actually stored on disk. The file system in this directory is called the proc file system, which is an image of the system kernel. That is, the files in this directory are stored in system memory. You can see how the system is running by looking at these files, and you may change some kernel running parameters by modifying these documents.

The default home directory of the root superuser root does not have write permission for the average user. In general, users' own files are copied to their own main directory, so as not to disturb the original system hierarchy.

Like / bin, sbin mainly stores executable files, except that the executable files here are mainly used for super-users to manage the system, and ordinary users have little permission to execute the programs in them. The documents include mke2fs,ifconfig and so on.

Tftpboot TFTP (Common File transfer Protocol) server default file home directory

Tmp is the same as the TEMP directory of DOS or WINDOWS, where temporary files are stored

The usr directory is the largest disk-occupying directory in the Linux system. There are many applications and its subdirectories are relatively complex.

Var stores some system record files, and the data from HTTP and FTP servers are also stored in a subdirectory of this directory.

Thank you for your reading, the above is the content of "the standard directory structure of linux", after the study of this article, I believe you have a deeper understanding of the standard directory structure of linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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