A detailed description of the file directory structure in the Linux operating system

Source: Internet
Author: User

A detailed description of the file directory structure in the Linux operating system


1. Directory structure and main content:


1) the "/" root directory section has the following subdirectories:


The/usr directory contains all commands, libraries, documents, and other files. These files will not be changed during normal operation. This directory also contains the main applications for your Linux distribution, for example, Netscape.


The/var directory contains files that were changed during normal operation: Spool files, record files, lock files, temporary files, and page format files.


The/home directory contains the user's files: parameter settings files, personalization files, documents, data, EMAIL, cached data, and so on. This directory should be maintained at the system provincial level.


The/proc directory contains all the unreal files. They do not actually exist on the disk, and they do not occupy any space. (Ls–l can be used to display their size) when viewing these files, they are actually accessing the information that exists in memory, which is used to access the system


/bin the execution files (binary) that are required for the system to be started, these files can be used by ordinary users.


/sbin System execution files (binary), these files are not intended to be used by ordinary users. (normal users can still use them, but specify a directory.) )


/etc Operating system configuration file directory.


The home directory of the/root system administrator (also called superuser or root user).


/dev Device file directory. Linux devices are treated as files, which allows the hardware to be abstracted, read-write, network-shared, and temporarily loaded into the file system. Under normal circumstances, the device will have a separate subdirectory. The contents of these devices will appear in separate subdirectories. Linux does not have a so-called driver.


/lib a shared library of programs and core modules under the root file system directory.


/boot files for the bootstrap loader (LILO or GRUB). When the computer starts (if there are multiple operating systems, it is possible to allow you to choose which operating system to start), these files are first loaded. This directory will also contain the Linux kernel (compressed file vmlinuz), but the Linux kernel can also exist elsewhere, as long as Lilo is configured and Lilo knows where the Linux kernel is.


/opt optional applications, such as KDE under REDHAT 5.2 (REDHAT 6.0, KDE in other xwindows applications, main execution program in/usr/bin directory)


/tmp temp file. The directory will be cleaned up automatically.


/lost+found files recovered during file system repair


2) The more important parts of the "/usr" directory are:
/USR/X11R6 x-windows System (version one, release 6)


/usr/x11 with/USR/X11R6 (/USR/X11R6 's symbolic Connection)


/usr/x11r6/bin a large number of small x-windows applications (and possibly symbolic connections for large execution of files in other subdirectories).


/usr/doc Linux documentation (in the updated system, this directory is moved to/usr/share/doc).


/usr/share separate the data from your computer structure, for example, the words in a dictionary.


/usr/bin and/usr/sbin are similar to directories under the "/" root directory (/bin and/sbin), but are not used for basic booting (for example, in emergency maintenance). Most of the commands are in this directory.


/usr/local an application installed by a local administrator (or a separate subdirectory may be available for each application). After the "main" installation, this directory may be empty. Content in this directory should exist after reinstalling or upgrading the operating system.


/usr/local/bin may be a user-installed small application, and some symbolic connections to large applications in the/usr/local directory.


3) Contents of the/proc directory:


/proc/cpuinfo information about the processor, such as type, manufacturer, model, and performance.


/proc/devices the list of all devices configured by the current running kernel.


/PROC/DMA The DMA channel that is currently in use. /proc/filesystems the file system that is currently running the kernel configuration.


/proc/interrupts is using the interrupt, and how many interrupts were there.


/proc/ioports the I/O port that is currently in use.


For example, use the following command to read the CPU information of the system.


Cat/proc/cpuinfo


/bin:bin is the abbreviation of binary. This directory inherits the structure of the UNIX system and stores the commands most often used by the user. such as CP, LS, cat, and so on.


/boot: Here are some of the core files used when starting Linux.


/dev:d ev is the abbreviation for device. This directory is the external device for all Linux, which functions like the. SYS and the. vxd under Win in DOS. In Linux, devices and files are accessed in the same way. For example:/dev/hda represents the first physical IDE hard disk.


/etc: This directory is used to store the configuration files and subdirectories required for system administration.


/home: The user's main directory, such as a user named Wang, then his home directory is/home/wang can also be expressed in ~wang.


/lib: This directory contains the system's most basic dynamic link sharing library, which acts like a. dll file in Windows. These shared libraries are required for almost all applications.


/lost+found: This directory is usually empty, and when the system is not properly shut down, it becomes a refuge for homeless files. Yes, a bit like the. chk file under DOS.


/MNT: This directory is empty, the system provides this directory is to let users temporarily mount other file system.


/proc: This directory is a virtual directory, it is the mapping of system memory, we can access this directory directly to obtain system information. In other words, the contents of this directory are not on the hard disk but in memory.


/root: The home directory of the system administrator (also called the Superuser). As the owner of the system, there must be some privilege! For example, you have a single directory.


/sbin:s is the meaning of super user, which means that the management program used by the system administrator is stored here.


/tmp: This directory, needless to say, must be the place to store some temporary files.


/usr: This is the largest directory, and almost all of the applications and files we use are stored in this directory. It contains the following subdirectories;


/USR/X11R6: The directory where the X-window is stored;


/usr/bin: There are many applications stored;


/usr/sbin: Here are some of the management programs that are used for super users;


/usr/doc: This is the base of the Linux documentation;


/usr/include Inux to develop and compile the application needed header files, find here;


/usr/lib: To store some common dynamic link shared libraries and static archives;


/usr/local: This is the/USR directory provided to the general user, where the software installation is most suitable;


/usr/man:man is a synonym for help in Linux, and here is the directory where the help documents are stored;


/USR/SRC Inux Open Source code on the existence of this directory, enthusiasts do not let go Oh!


/var: This directory contains the things that are constantly being expanded, in order to maintain the relative stability of/usr, those directories that are often modified can be placed in this directory, in fact, many system administrators do this. Incidentally, the system's log files are in the/var/log directory.


2. In conclusion:


· The user should present the file under the/home/user_login_name directory (and its subdirectories).
· In most cases, the local administrator installs additional software in the/usr/local directory and signs the main execution program that is connected under/usr/local/bin.
· All settings of the system are in/etc directory.
· Do not modify anything in the root directory ("/") or/usr directory unless you really know what to do. These directories are best kept consistent with Linux publishing.
· Most tools and applications are installed in the directory:/bin,/usr/sbin,/sbin,/usr/x11/bin,/usr/local/bin.
· All the files are under a single directory tree. There's no "driver."

A detailed description of the file directory structure in the Linux operating system

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.