Linux directory Structure (ii)

Source: Internet
Author: User
Tags system log

The structure of the Linux file system knot is a tree structure whose entry starts/begins to understand the structure of the Linux file system and one of the basic points we need to master.
2, the document system's organizational structure is simple to say;
When you use Linux, if you go through Ls-la/you will find that there are many directories, such as etc, USR, var, bin ... directories, and in these directories, we enter
Go and see that there are also a lot of directories or files. The file system looks like a tree structure under Linux, so we can refer to the structure of the file system as a tree-shaped structure.
Look at the structure of the filesystem, which we can do with the tree command;
[Email protected] ~]# tree
However, the tree command is now missing in Fedora Core 5.0 and remains in the Slackware 10.2 version. But other versions of Linux should have; the output from the tree command
As a result, the top should be/, we call Linux root, that is, the Linux operating system file system. The entry of the Linux file system is/, all directories, files, devices are
,/is the organizer of the Linux file system and the leader of the most advanced.
Below we list the main directory of the tree structure of the Linux file system, mainly
3, the file system organizational structure analysis;
Analysis of the organizational structure of the file system, what can we analyze? That is, when we list/table of contents, we see the/usr,/etc ..../var etc directory is what to do with these directories are not there
For specific purposes. No matter which version of the Linux system, there are these directories, these directories should be standard. Of course, there are some small differences between Linux distributions, but the overall
, it's still roughly the same.
The difference between Linux distributions is actually very small, the difference is mainly in the system management of the characteristics of the tool and the package management method of different, in addition, there is no big difference, such as Fedora Soft
Package management tool is RPM, and Slackware is Pkgtool or installpkg, etc.;
To the next, let's go on to the file system organization structure.
/Linux File System entry, is also at the highest level of the directory;
The commands required by the/bin base system are located in this directory and are required by the smallest system, such as LS, CP, mkdir, and so on, and the functions and/usr/bin are similar, the files in this directory are
is an executable command that can be used by ordinary users. The most basic command required to be a basic system is to put it here.
The boot/boot Linux kernel and the files required for booting system programs, such as the Vmlinuz initrd.img files, are located in this directory. Under normal circumstances, the grub or LILO system Boot Manager also
Located in this directory;
/dev Device file storage directory, such as sound card, disk ...
/etc System configuration file location, some server configuration files are also here, such as user account and password configuration file;
/home directory is the default directory for ordinary users;
/lib Library File storage Directory
/lost+found in the ext2 or ext3 file system, when the system crashes unexpectedly or the machine shuts down unexpectedly, some file fragments are placed here. When the system starts, the Fsck tool checks here,
and repair the corrupted file system. Sometimes problems with the system, a lot of files are moved to this directory, may be repaired in a manual way, or moved to the original location of the file.
/media plug-and-play storage device mount point is automatically created in this directory, such as the USB disk system automatically mounts, will be in this directory generated a directory; Cdrom/dvd automatically mount,
A directory will also be created in this directory, similar to the CDROM directory. This is only available on the latest release kits, such as Fedora Core 4.0 5.0. Can see the definition of/etc/fstab;
/misc
/mnt This directory is typically used to store mounted storage devices, such as CDROM directory. You can see the definition of/etc/fstab. Sometimes we can put the system on automatic mount
File system, it is also possible to place the mount point here. The main view is how to define the/etc/fstab, such as CD-ROM can be mounted to the/mnt/cdrom.
/OPT represents the optional meaning, and some packages are also installed here, which is the custom package, such as in Fedora Core 5.0, where OpenOffice is installed. Some of my
Can be installed in this directory, and the software installed through the source package is available through the./configure--prefix=/opt/directory.
When the/proc operating system is running, the process (running program) information and kernel information (such as CPU, hard disk partition, memory information, etc.) are stored here. /proc directory masquerading file system proc
Mount Directory, Proc is not a real file system, and its definition can be found in/etc/fstab.
/root the home directory for Linux super User root;
/sbin is mostly involved in system management of the command store, is super-user root executable command storage, ordinary users do not have permission to execute this directory commands, this directory and/usr/sbin;
The/usr/x11r6/sbin or/usr/local/sbin directories are similar; we'll remember that all of the directories sbin contain root permissions to perform.
/tmp Temporary file directory, sometimes when users run the program, will produce temporary files. /tmp is used to store temporary files. The/var/tmp directory is similar to this directory.
/usr This is a directory of system storage programs, such as commands, help files, and so on. There are a lot of files and directories under this directory. When we install a Linux distribution that is officially provided by a package, most
Installed here. If a server configuration file is involved, the configuration file is installed in the/etc directory. The/usr directory includes the font directory/usr/share/fonts, help directory/usr/share/man
or/usr/share/doc, the normal user can execute the file directory/usr/bin or/usr/local/bin or/usr/x11r6/bin, the super-user root executable command storage directory, such as/usr/sbin
or/usr/x11r6/sbin or/usr/local/sbin, etc., and the program's header file holds the directory/usr/include.
/var The content of this directory is constantly changing, see the name to know, we can understand as vary abbreviation,/var under/var/log This is used to store the system log directory. The/var/www directory is a fixed
Semantic Apache Server site storage directory,/var/lib used to store some library files, such as MySQL, and MySQL database storage;
Let us add some more important directories to use;
/ETC/INIT.D This directory is used to store scripts that the system or server starts in System V mode, which is common in systems that are started or initialized in the mode v. such as Fedora/redhat;
/ETC/XINIT.D if the server is running in xinetd mode, its script will be placed in this directory. Some systems do not have this directory, such as Slackware, and some older versions do not.
In Rehat/fedora, a newer version exists in the comparison.
/ETC/RC.D This is a directory of the Slackware distribution, which is the location of the BSD startup script, such as defining the NIC, the server opening script, etc.
/ETC/X11 is the location of x-windows related configuration files;
For example, the following:
[[email protected] ~]#/etc/init.d/sshd start Note: Start the sshd server
[[email protected] ~]#/etc/init.d/sshd Stop Note: Stop the SSHD server
Start sshd: [OK]
This is the typical sshd server System V-mode startup script, which runs this script to start the sshd server.
/usr/bin This directory is a directory of executable programs, the normal user has permission to execute, when we install a program from the system's own package, most of his executable files will be placed in this directory.
such as when installing the Gaim software package. Similar directories are/usr/local/bin; sometimes files in/usr/bin are/usr/local/bin linked files;
/usr/sbin This directory is also a directory of executable programs, but mostly contains commands that involve system administration. Only root privileges can be performed; similar directories are/sbin or/usr/local/sbin
or/usr/x11r6/sbin, etc.;
/usr/local This directory is generally used to store the user self-compiled installation software storage directory, usually through the source package installed software, if not specifically installed directory, is generally installed in
In this directory. There are subdirectories under this directory. Check it out for yourself.
/usr/lib and/lib directory is similar, is the library file storage directory;
/usr/share System common store of things, such as/usr/share/fonts is a font directory, users are common.
/usr/share/doc and/usr/share/man Help file, is also common use it;
/USR/SRC is the kernel source directory, such as the following kernel source directory, such as Linux, linux-2.xxx.xx directory. Some systems will also install the source software package here. Than
such as Fedora/redhat, when we install FILE.SRC.RPM, these packages will be installed in the corresponding directory/usr/src/redhat. Please refer to: "file.src.rpm use method of the simple
Single introduction. In addition Fedhat 4.0 5.0, the directory of his kernel source package is located in a directory under the/usr/src/kernels directory (only after the installation will generate the corresponding directory);
/var/adm such as package installation information, logs, management information, etc., in the Slackware operating system has this directory. It doesn't seem to be in fedora, so take a look.
/var/log System log storage, analysis log to see this directory of things;
/var/spool printer, mail, proxy server, such as spool directory;

Linux directory Structure (ii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.