Linux directory tree

xiaoxiao2021-03-06  118

The directory tree can be divided into a small portion, each of which can be on its own disk or partition. The main part is root, / usr, / var, and / home file system. Each section has a different purpose.

Each machine has a root file system, which contains the system boot and enables files necessary for Mount to Mount, and the root file system should have enough content necessary for single user status. It should also include tools to repair damaged systems, recover backups, and the like.

The / USR file system contains all commands, libraries, man pages, and other unlilled files required in general operations. / USR should not have files to be modified in general use. This allows the files in this file system to share through the network, which can be more effective, because this saving disk space (/ usr is easy to be hundreds of trill), and is easy to manage (when upgrading the application, only the master / usr needs to change, There is no need to change each machine) Even if this file system is on this site, you can read only Mount to reduce the damage of the file system when the system crashes.

/ VAR file system contains files that will be changed, such as spool directory (Mail, News, printer, etc.), log files, formatted manual pages, and temporary files. Traditionally / var's all things have been in / usr, but such / usr cannot be read-only.

The / Home file system contains all actual data on the system. A large / home may be divided into a number of file systems, need to add first level names in / home, such as / home / students, / home / staff, etc.

Although different parts are called different parts as a file system, they don't have to be a real separated file system. If the system is a small single user system, and the user wants to simplify, it can be easily placed in a file system. The directory tree can also be divided into different file systems depending on the space required for disk capacity and different purposes. It is important to use standard names, even on / var and / usr on the same partition, name /usr/lib/libc.a and / var / us must work, such as moving files under / VAR to / us / var and the / var as a symbolic connection of / usr / var.

The UNIX file structure is packet files based on the purpose, that is, all the commands in one place, all the data in another place, all documents are in one place, and so on. Another method is based on a program packet file, that is, all Emacs files in a directory, all TEX files in another, and so on. The problem of the latter method is that the document is difficult to share (the program directory often contains static and dynamic unsocvisible files), sometimes it is difficult to find (such as the MAN page in a large number of places, making the Man program to find them extremely difficult) .

Root file system

Root file systems should generally be relatively small, because including strict files and a small unusible file system is not easily damaged. Damaged root file systems generally means that unless a specific method (eg, slave floppy disk) system cannot be guided.

The root directory generally does not contain any files, in addition to possible standard system boot images, usually called / Vmlinuz. All other files are in the subdirectory of the root file system.

/ bin

Boot the command to start the desired command or the command that the normal user may use (may be booted).

/ sbin

Similar / bin, but do not use ordinary users, although it can be used if necessary and allowed.

/ ETC

Specific machine configuration file.

/ root

Root user's home directory.

/ lib

The shared library required for the program on the root file system.

/ lib / modules

The core can load module, especially those required to resume the damage (such as network and file system driver).

/ dev

Device file.

/ TMP

Temporary Files. The program that is boot started should use / var / tmp, not / TMP, because the former may be on a disk with more space.

/ boot

Bootstrap Loader, such as LILO. The core image is often here, not at the root directory. If there are many core pictures, this directory may become large, then you may use a separate file system better. Another reason is to ensure that the core image must be in the top 1024 cylinders of the IDE hard drive. / MNT

System administrator temporary mount installation point. The program does not automatically support installation to / mnt. / MNT can be divided into a subdirectory (such as / MNT / DOSA may be a floppy drive using the MSDOS file system, and / MNT / EXTA may be a floppy drive using an EXT2 file system).

/ proc, / usr, / var, / home

Other file systems installation points.

/ etc directory

The / etc directory contains many files. Many network configuration files are also in / etc.

/ etc / rc or /etc/rc.d or /etc/rc*.d

Start, or change the scripts or scripts of the Scripts or Scripts running when you run.

/ etc / passwd

The user database, where the domain gives the username, the real name, the home directory, encrypted passwords and other information.

/ ETC / FDPRM

Floppy disk parameter table. Note Different floppy disk formats. Set with SetFDPRM.

/ ETC / FSTAB

Mount -a command (in / etc / rc or equivalent startup file) Automatic Mount file system list. Under Linux, information is also included in the SWAP area enabled with swapon -a.

/ etc / group

Similar / etc / passwd, but instructions are not users but groups.

/ etc / inittab

INIT's profile.

/ ETC / ISSUE

Getty output information before the login prompt. It usually includes a short description or welcome information of the system. The content is determined by the system administrator.

/ etc / magic

File configuration file. Instructions containing different file formats, FILE is based on it guess file type.

/ etc / motd

Message of the day, automatically output after successfully logging in. The content is determined by the system administrator. Frequently used for advertisement information, such as a warning of the shutdown time.

/ ETC / MTAB

Currently installed file system list. Initialized by Scripts and automatically update by the mount command. Requires a list of currently installed file systems, such as DF commands.

/ etc / shadow

Shadow password file on the system of shadow password software installed. The shadow password file moves the encryption port in the / etc / passwd file to / etc / shadow, while the latter is only read to root. This makes the decipherous password more difficult.

/etc/login.defs

The profile of the login command.

/ etc / printcap

Similar / etc / termcap, but for printers. The grammar is different.

/ etc / profile, /etc/csh.login, /etc/csh.cshrc

Log in or start the file that Bourne or c shells executes. This allows the system administrator to establish a global default environment for all users.

/ etc / securetty

Confirm the security terminal, which terminal allows root to log in. Generally, only virtual console is usually listed, so it is impossible (at least very difficult) intrusion into the system through the MODEM or network, and get superuser privileges.

/ etc / shells

List the trusted shell. The chsh command allows the user to change the login shell within the specified range of this document. Providing a machine FTP service service process FTPD checks if the user shell is listed in the / etc / shells file, if it is not allowed to log in.

/ etc / termcap

Terminal Performance Database. Explain what "escape sequence" control is used by different terminals. When writing programs, the escape sequence is not directly output (which can only work in a particular brand of terminals), but lookup the correct sequence of the work you want to do from / etc / termcap. In this way, most programs can run on most terminals.

/ dev directory

The / dev directory includes device files for all devices. Device file is named with a specific agreement.

/ usr file system

/ USR file system is often very large because all programs are installed here. All files in usr generally come from Linux Distribution; locally installed programs and other things under / usr / local. This may not need to reinstall all programs when upgrading a new system or new Distribution.

/ usr / x11r6

X Window system all files. To simplify the development and installation of X, the X files are not integrated into the system. X yourself like / usr under / usr / x11r6.

/ usr / x386

Similar / usr / x11r6, but give x11 release 5.

/ usr / bin

Almost all user orders. Some commands are in / bin or / usr / local / bin.

/ usr / sbin

The root file system is unnecessary system management command, such as most service programs.

/ USR / MAN, / USR / INFO, / USR / DOC

Handbook, GNU information documentation and various other document files.

/ usr / include

C programming language header file. In order to consistency this, this is actually under / usr / lib, but it is traditionally supported this name.

/ usr / lib

The unchanged data files of the program or subsystem include some Site-Wide profiles. Name lib comes from library; programmed raw stock in / usr / lib.

/ usr / local

The local installed software and other files are placed here.

/ VAR file system

/ var includes data to be changed when the system is generally run. Each system is specific, that is, not shared with other computers over the network.

/ VAR / CATMAN

Cache of the Man page when it is required to format it. The source file of the Man page generally exists / usr / man / man *; some MAN pages may have pre-formatted versions, exist / usr / man / cat *. Other MAN pages need to format, the formatted version of the version exists / var / man, so others do not wait to format the same page. (/ VAR / CATMAN is often cleared, just like clearing the temporary directory.)

/ VAR / LIB

The file to change when the system is running.

/ VAR / LOCAL

The variable data of the program installed in USR / local (that is, the system administrator installed by the system administrator). Note that if necessary, even if the program is installed, other / var directories, such as / var / lock.

/ VAR / LOCK

Lock files. Many programs follow the conventions of a locked file in / var / lock to support them being using a particular device or file. Other programs notice this lock file, will not try to use this device or file.

/ VAR / LOG

Log files of various programs, especially login (/ var / log / wtmp log all to system login and logging) and syslog (/ var / log / messages store all core and system program information. / Var / log Documents are often uncertain, and should be cleared regularly.

/ VAR / RUN

Save the information files that are valid before the next boot. For example, / var / run / utmp contains information about the user currently logged in.

/ var / spot

Mail, news, print queues and directories for other queues work. Each different spool has its own subdirectory under / var / spool, for example, the user's mailbox is in / var / spool / mail.

/ VAR / TMP

The ratio / TMP allows for large or need to have a long period of time. (Although the system administrator may not allow / var / tmp with very old files.)

/ PROC file system

/ Proc file system is a fake file system. It does not exist on a disk on disk. Instead, it is generated by the core in memory. Used to provide information about the system (Originally About Processes, Hence the Name). Hereinafter, some of the most important files and directories are explained.

/ proc / 1

About the information directory of the process 1. Each process has a directory named its process number under / proc. / proc / cpuinfo

Processor information, such as type, manufacturer, model, and performance.

/ proc / devices

A list of device drivers currently running the core configuration.

/ Proc / DMA

Displays the current DMA channel.

/ proc / filesystems

The core configuration of the file system.

/ proc / interrupts

Displayed interrupts, And how much of each there have been.

/ Proc / Ioports

The currently used I / O port.

/ proc / kcore

System physical memory image. Like the physical memory size, but not actually occupying so many memory; IT IS generated on the fly as programs access it. (Remember: Unless you copy it where you copy it, there is no disk space under / proc. )

/ Proc / KMSG

Core output message. Also sent to syslog.

/ proc / ksyms

Core symbol table.

/ proc / loadingavg

The system "average load"; 3 indicators indicate the current workload of the system.

/ proc / meminfo

Memory usage information, including physical memory and SWAP.

/ proc / modules

What core modules are currently loaded.

/ proc / net

Network protocol status information.

/ Proc / Self

A symbolic connection to the process directory of the program that views / proc. It is a different connection when 2 processes view / proc. This is primarily facilitated to get its own process catalog.

/ proc / stat

Different status of the system, Such as the number of page faults since the system was booted.

/ proc / uptime

The length of the system starts.

/ Proc / Version

Core version.

转载请注明原文地址:https://www.9cbs.com/read-98160.html

New Post(0)