I recommend a very good Linux File System for you to learn. Here I will mainly explain the application of the Linux File System, including introduction to the knowledge of the Linux File System. The structure of the Linux File System is a tree structure. The entry begins with/to understand the structure of the Linux File System. It is one of the basic knowledge points that we need to master.
1. What is a Linux File System? See: Linux File System Overview
2. Organization Structure of the Linux File System;
When you use a Linux file system, if you use ls-la/, you will find that there are many directories under, for example, etc, usr, var, bin ...... and in these directories, we went in and saw that there are also many directories or files. The Linux File System looks like a tree structure in the Linux file system. Therefore, we can name the structure image of the Linux File System a tree structure.
To view the structure of the Linux file system, we can use the tree Command; [root @ localhost ~] # The tree does not pass the tree Command. Currently, the command has disappeared from Fedora Core 5.0 and is retained in Slackware 10.2. However, other versions of Linux file systems should have;
From the output result of the tree Command, the top part should be/, which we call/as the root of the Linux file system, that is, the Linux File System of the Linux File System. The entry to the Linux File System for a Linux File System is/. All directories, files, and devices are under/./is the organizer of the Linux File System and the leader of the Linux File System.
Next we will list the main directories in the tree structure of the Linux File System.
3. Linux File System organization structure analysis;
What can we analyze the organizational structure of the file system? That is, when we see the/usr,/etc ...... /var and other directories are used for specific purposes. No matter which version of the Linux File System has these directories, these directories should be standard. Of course, there will be some minor differences between the distributions of various Linux file systems, but in general, it is still roughly the same.
In fact, there are few differences between Linux File System releases. The differences are mainly manifested in the differences between system management tools and software package management methods. In addition, there is no major difference; for example, the rpm ora software package management tool is rpm, And the Slackware is pkgtool or installpkg;
To put it bluntly, let's talk about the organizational structure of the Linux File System.
/The entry to the Linux File System is also the directory at the highest level; the commands required by the/bin basic system are located in this directory, which is also required by the minimum system; such as ls, cp, mkdir, and other commands. The functions are similar to those of/usr/bin. files in this directory are executable and can be used by common users. The most basic command required for the basic system is put here.
/Boot the Linux File System Kernel and the files required by the boot system program, such as vmlinuz initrd. img files, are all in this directory. In general, GRUB or LILO System Boot manager is also located in this directory;/dev device file storage directory, such as sound card, disk ...... the location of the/etc system configuration file, where some server configuration files are also located, such as the user account and password configuration files;
/Home is the default storage directory of the home directory for normal users;/lib library file storage directory/lost + found is in the ext2 or ext3Linux file system. When the system crashes or the machine shuts down unexpectedly, some file fragments are generated here. When the system is started, The fsck tool checks this and fixes the damaged Linux File System.
Sometimes a system problem occurs. Many files are moved to this directory and may be repaired manually or moved to the original location. /The mount point of the media plug-and-play storage device is automatically created under this directory. For example, after the USB disk system is automatically mounted, a directory is generated under this directory;
After CDROM/DVD is automatically mounted, a directory will also be created in this directory, similar to the cdrom directory. This is available only on the latest release kit, such as Fedora Core 4.0 5.0. See the definition of/etc/fstab. The/misc/mnt directory is generally used to store the mounted directory of the mounted storage device, such as cdrom.
See the definition of/etc/fstab. Sometimes we can enable the system to automatically mount the Linux File System at startup, and put the mount point here. It mainly depends on the definition in/etc/fstab. For example, the optical drive can be mounted to/mnt/cdrom. /Opt indicates the optional meaning. Some software packages will also be installed here, that is, custom software packages.
For example, in Fedora Core 5.0, OpenOffice is installed here. Some software packages compiled by ourselves can be installed in this directory. The software installed through the source package can be installed through the./configure -- prefix =/opt/directory. /Program running in the proc operating system) and kernel information such as cpu, hard disk partition, and memory information) are stored here.
The/proc directory is the mounted directory of proc in the disguised Linux File System. proc is not a real Linux File System. For its definition, see/etc/fstab. /Root Linux File System root's home directory;/sbin stores mostly commands related to system management, and is the place where super-privileged root can store executable commands, normal users have no permission to execute commands in this directory, which is similar to/usr/sbin;/usr/X11R6/sbin or/usr/local/sbin; remember, all the contents in sbin can be executed only with the root permission.
/Tmp temporary file directory. Sometimes, when you run a program, a temporary file is generated. /Tmp is used to store temporary files. The/var/tmp directory is similar to this directory. /Usr is the directory where the system stores programs, such as commands and help files. This directory contains many files and directories.
Most of the software packages officially provided by the Linux File System release are installed here. If a server configuration file is involved, the configuration file will be installed in the/etc directory. The/usr directory contains the/usr/share/fonts directory, the help directory/usr/share/man or/usr/share/doc, common users can execute the file directory/usr/bin or/usr/local/bin or/usr/X11R6/bin. The root executable command can be stored in the directory, for example,/usr/sbin or/usr/X11R6/sbin or/usr/local/sbin, And the header file directory of the Program/usr/include.
The content of the/var directory is changed frequently. You can see the name of the Directory, which is abbreviated as vary./var contains/var/log, which is the directory used to store system logs. The/var/www directory defines the directory where the Apache server site is stored;/var/lib is used to store some library files, such as MySQL and the location where the MySQL database is stored;
Let's add some important usage of directories;/etc/init. d. This directory is used to store the scripts started by the System or server in System V mode, which is common in Systems started or initialized in System V mode. For example, Fedora/RedHat;
/Etc/xinit. d if the server runs in xinetd mode, put its script in this directory. Some systems do not have this directory, such as Slackware, and some old versions do not. In Rehat/Fedora, a new version is compared.
/Etc/rc. d is a directory of the Slackware release, where the bsd startup script is stored, such as defining the NIC and enabling the script on the server. /Etc/X11 is the location where X-Windows-related configuration files are stored. For example:
- [Root @ localhost ~] #/Etc/init. d/sshd start Note: start the sshd server
- [Root @ localhost ~] #/Etc/init. d/sshd stop Note: stop the sshd server
-
- Start sshd: [OK]
This is a typical sshd server startup script in System V mode. You can run this script to start the sshd server. The/usr/bin directory is the directory of executable programs, and normal users have the permission to execute them. When we install a program from the software package that comes with the system, most of his executable files are stored in this directory.
For example, when installing the gaim software package. A similar directory is/usr/local/bin. Sometimes the file in/usr/bin is a link file of/usr/local/bin; the/usr/sbin directory is also the directory of executable programs, but most of them store commands related to system management. Only the root permission can be executed. Similar directories include/sbin or/usr/local/sbin or/usr/X11R6/sbin;
The/usr/local directory is generally used to store the user's self-compiled and installed software. It is generally installed through the source code package. If the installation directory is not specified, it is usually installed in this directory. This directory contains subdirectories. Let's take a look.
The/usr/lib directory is similar to the/lib directory, which is the storage directory of the library files. the/usr/share system stores the shared items. For example,/usr/share/fonts is the font directory, it is shared by all users. /Usr/share/doc and/usr/share/man help files are also shared;
/Usr/src is the directory where the kernel source code is stored. For example, the following directory contains the kernel source code, such as the Linux File System and the Linux File System-2. xxx. xx directory. Some systems also install the source code package here. For example, Fedora/Redhat. When we install file. src. rpm, these packages will be installed in the corresponding directory of/usr/src/redhat.
See file. src. rpm for a brief introduction. In addition, for Fedhat 4.0 5.0, the Directory of his kernel source code package is located in a directory under the/usr/src/kernels directory and the corresponding directory is generated only after installation );
/Var/adm, such as the installation information, logs, and management information of the software package, has this directory in the Slackware operating system. It does not seem to exist in Fedora; check it yourself. /Var/log system log storage. The analysis log depends on the contents in this directory;/var/spool printer, mail, proxy server, and other offline directories;
4. Matters not covered in this article;
Since the Linux file system has many releases, there is always a difference, but it is still similar in general. Take a look at the multi-column directory and you will understand it. There are many Windows directories, and we do not know what it is used for, but we use Windows as well. Now, in Linux, you can click the mouse to view these directories. If you don't use the command, you will always see it when you click it, right?
This article is an integral part of the Linux File System. It is essential for a series of documents and is also one of the basic documents. This is because I have tried to introduce the Linux File System-related operations. New handwritten. writing a document is a persistent process. Writing a document still gives me a lot of fun. I don't feel much pain when I write a document at leisure. If one thing is regarded as a stress, there is no fun. If so, it is better not to do it. Later, I may write content related to the Linux File System, such as creating, deleting, moving, attributes, and permissions;
- Partitions of storage devices in the Linux File System
- Linux File System directory structure
- Partitioning and formatting Linux USB flash disks and creating Linux File Systems
- How to detach a linux File System from a computer
- Briefly describe the organizational structure of the Linux File System