Filesystem Hierarchy Standard (file system directory standards) abbreviations, most Linux versions of this file organization, similar to the Windows operating system in the C-disk file directory, FHS tree structure to organize files. In fact, FHS is only the specification of what files should be placed in each of the main directories under the root directory (/).
FHS defines the two layer specification, the first layer is,/below the directory should be put what file data, such as/etc should be placed in the settings file,/bin and/sbin should be placed executable files and so on. Because there are so many developers of Linux, if everyone uses their own directory configuration method, it can lead to a lot of management problems. Can you imagine that after you entered a business, the Linux directory configuration method that you came into contact with was completely different from what you learned before? It's hard to imagine. So, later on there is the so-called file system hierarchy Standard (Filesystem Hierarchy STANDARD,FHS) introduced. The second tier is defined for sub-directories of the/USR and/var directories. For example,/var/log places system login files,/usr/share places shared data, and so on.
Since FHS is only the file data that defines the contents of the top (/) and sub-tiers (/usr,/var) should be placed, it can be configured with the developer at the other subdirectory level. For example, FC4 's network setup data is placed in the/etc/sysconfig/network-script/directory, but SuSE Server 9 places the network under the/etc/sysconfig/network/directory, and the directory name is different.
In addition, in Linux, all files and directories are started by the root directory. That is the source of all directories and files. Then one more branch down, a bit like a tree. Therefore, we also call this directory configuration as: "Directory Tree". The main features of this directory tree are:
The starting point of the directory tree is the root directory (/, root).
Each directory can not only use the file system of the local partition, but also the file system on the network. For example, you can use a network file system (SYSTEM,NFS) server to load a specific directory, and so on.
Each file name (including the full path) in this directory tree is unique.
In addition, the path is defined as an absolute path (absolute) and a relative path (relative), depending on how the file name is spelled. The absolute path is: The file name or directory name that is written by the root (/), such as/HOME/DMTSAI/.BASHRC, and the relative path is the file name that corresponds to the current path. For example./home/dmtsai or. /.. /home/dmtsai/and so on. Anyway, the beginning is not/is a relative path to the wording. It is important to understand that the relative path is represented by the relative position of the current path. For example, in the/home directory, if you want to enter the/var/log directory, how to write it?
Cd/var/log (absolute)
Cd.. /var/log (relative)
Because in/home, so go back to the previous layer (.. /) Before you can continue moving to/var.
Pay particular attention to these two special directories:
.: Represents the current directory, or it can be used./to indicate.
.. : Represents the previous level of the directory, or you can ... /to indicate.
. With.. The catalog concept is important and you will often see CDs. Or./command, which means the status of the previous layer and the current directory. In addition, the character limit size for file name and full file name (file name written by/start) is:
The maximum allowable file name for a single file or directory is 255 characters. The full file name containing the full path name and directory (/) is 4,096 characters long.
We know that there is a file named message under/var/log/, and the maximum file name for this message file can be up to 255 characters. The two upper-level directories, VAR and log, can be up to 255 characters long, respectively. In general, however, the full file name of/var/log/messages can be up to 4,096 characters long.
Tip: Root has a lot of meaning in Linux. If from the "account" point of view, Root refers to "system administrator" identity, if the "directory" point of view, root refers to the root directory, is/. Pay special attention to it.