What the document is Linux? What is its file system is? Those profiles, then where? I downloaded the program where to save it? In the Linux file system is the standard configuration it? Well, on the map concisely explain the hierarchy of the Linux file system. When you're struggling to find the configuration file or binary file, which it appears to be very useful. Below I added some explanation and examples, but "lengthy, it can be free to look."
Another case is when you get the configuration and binary files in the system, there has been inconsistency, if you are in a large organization, or just an end user, it might also destroy your system (for example, binaries run on the old library files). If so, what do you do a security audit on your Linux system, you will find it very vulnerable to various attacks. So, maintain a clean operating system (either Windows or Linux) are very important.
What Linux files are?
For UNIX systems (also for Linux), the following is a brief description of the file:
On UNIX systems, everything is a file; if not file, for the process
This definition is more correct, as some special files not just an ordinary file (such as named pipes and sockets), but to make things simple, "everything is a file" is an acceptable argument . Linux systems like UNIX systems, files and directories as visual objects, just because the directory that contains other file names only. Programs, services, text, images, etc., are all files. For the system, the input and output devices, substantially all of the equipment, are treated as a file.
Topic map Version History:
Version 2.0 - 17-06-2015
- Improved: add a title and version history
- Improved: add the / srv, / meida and / proc
- Improved: Updated to reflect current Linux file system description
- Fixed: multiple printing error
- Fixed: appearance and color
Version 1.0 - 14-02-2015
- Created: Basic Chart
- Note: abandon lower version
Linux file system descriptor
In order to manage those files in an orderly manner, people used these documents as ordered tree structure on the hard disk, as we are familiar with 'MS-DOS' (Disk Operating System) is an example. Large branches contain more branches, leaves or branches endings are normal file tree. Now we will be in this tree, for example, late but we'll find out why this is not a completely accurate a picture.
/ Primary level root is the root directory of the entire file system hierarchy
/ Bin stored in single-user mode available the necessary command binaries, available to all users, such as cat, ls, cp, etc.
/ Boot storage boot loader file, for example, kernels, initrd etc.
/ Dev file storage necessary equipment, such as / dev / null
/ Etc stored host-specific system-wide configuration files. In fact, there is a name on its own sense of controversy. In earlier versions of the UNIX implementation of the document in Bell Labs, / etc represents "other (etcetera) catalog," because historically, this directory is located does not belong to a variety of other directories of files (however, the standard file system directory FSH Limited / etc used to store static configuration file, there should not be here binaries). After the early publication of the document, the name of the directory again defined as different forms. Recent interpretation contains "editable text configuration" or "extra kit" such as redefinition
/ Etc / opt to store the new package configuration file / opt /.
/ Etc / sgml store configuration files, such as catalogs, for those dealing with SGML (Translator's Note: Standard Generalized Markup Language) software configuration files
11 version of / etc / X11 X Window System configuration files
/ Etc / xml configuration files, such as catalogs, for those dealing with XML (Translator's Note: Extensible Markup Language) software configuration files
/ Home user's home directory, including the saved files, personal profile, etc.
Required library files / lib / bin / and / sbin / binary files
/ Lib necessary library file backup format. Such a directory is optional, but if they exist, then there is definitely a need to use their program
/ Mobile multimedia media (such as CD-ROMs) mount point. (Appeared in FHS-2.3)
/ Mnt temporary mount file systems
/ Opt Optional application packages
/ Proc process and provide information to the kernel files in the form of a virtual file system in Linux, the corresponding process file system (procfs) mount point
/ Root-root user's home directory
/ Sbin necessary system-level binary file, for example, init, ip, mount
Site-specific data / srv system provides
/ Tmp Temporary files (see also / var / tmp). Usually after a system reboot delete
/ Usr read-only two-level store user data; contains a (multi) user public key files and applications
/ Usr / bin non-essential command binaries (not needed in single-user mode used); for all users
/ Usr / include standard include file
/ Usr / lib library files for / usr / bin / and / usr / sbin / binaries
/ Usr / lib alternate format library (optional)
/ Usr / local for three levels of local data, specific to the host. There is usually a subdirectory, for example, bin /, lib /, share /.
/ Usr / local / sbin non-essential system binaries, such as for different network services daemon
/ Usr / share architecture-independent (shared) data.
/ Usr / src source code, such as the kernel source files and header files associated with it
/ Usr / X11R6 X Window system, version numbers: 11, Release: 6
/ Var variety of (Variable) file, some of the conventional operation system with continually changing files put here, such as log files, offline files, and temporary e-mail files
/ Var / cache application cache data. The data is time-consuming operation I or locally generated results / O (input / output). These applications are able to regenerate or restore the data. When no data is lost, you can delete cache files
/ Var / lib status information. This information along with operating procedures and constantly changing, for example, databases, packaging system metadata, etc.
/ Var / lock lock file. These files are used to track the resources being used
/ Var / log log file. It contains various log.
/ Var / mail contains the user's mailbox relevant documents
/ Var / opt from a variety of data are stored in the add-on package / var / opt /.
/ Var / run to store information about the current system since the last start, such as the current logged in user, and the currently running daemons (daemon).
/ Var / spool The spool is mainly used to store tasks to be processed, such as print queues and queue outbound e-mail
/ Var / mail outdated location for placing the user's mailbox file
/ Var / tmp to store temporary files after restart reserved
Linux file type
Most file is just a regular file, they are called regular files; they contain normal data, such as text, executable files or programs, input or output programs, etc.
Although you may think "in Linux, all you see are all files" this view pretty safe, but there is still some exceptions.
Directory: file consists of other files
Special Files: Ways for input and output. Most special files are stored in / dev, we will discuss this issue later.
Link File: Allows file or directory appears in the file system tree mechanism multiple locations. We will discuss this in detail with the linked file.
(Domain) sockets: a special file type, and TCP / IP protocol bit like sockets, providing inter-process communication network, and file system access control mechanisms protected.
Named Pipes: more or less like sockets (sockets) to provide a mechanism for inter-process communication, without network sockets.
The reality of the file system
For most users, and general system management tasks, "files and directories is an ordered tree-structure" is acceptable. However, for the computer and it is not going to understand what is a tree, or what is the tree structure.
Each partition has its own file system. Imagine, if you want to put those file systems as a whole, we conceived a tree structure on the whole system, but this is not so simple. In the file system, a file representing a inode (index node), which is a build file that contains the serial number of the actual data information: These data indicates that the file belongs to whom, as well as its location on the hard disk.
Each partition has a set of their own inode, in different partitions of a system, there can have the same inode file.
Each inode represents a kind of data structure on the hard disk, save the file attributes, including the physical address of the file data. When the hard disk is formatted and used to store data (usually occurs during the initial system installation process or in an existing system to add additional hard disk), each partition will create a fixed number of inode. This value represents the maximum number of partitions can also store all types of files. We usually go with a inode block map data of 2-8k. When a new file is generated, it will get a free inode. In this inode which stores the following information:
File owner and group owner
File types (regular files, directories, file ......)
Creation, last read and modified files of time
inode where the information was modified
The number of linked files (see next section)
The address of the actual file data
Inode information is not the only file names and directories. They are stored in a special directory files. By comparing file names and inode numbers, the system can construct a tree structure for users to understand. Users can view the number of inode by ls -i. On the hard disk, inodes have their separate space.