Linux system directory structure

Source: Internet
Author: User
Tags system log

1. Tree-like directory structure diagram

  

2. Introduction of Catalogue

Directory Describe

/

root directory

/bin/

Store binary executables such as: Cat, LS, CP, etc.

/boot/

Store files that need to be loaded when the Linux system starts. (usually saved in another disk partition) Kernel, grub and other files are stored here

/dev/

Contains device files. In Linux, everything is considered a file. Terminal devices, USB, disks, and so on are all considered files, such as/dev/sda

/etc/

Contains the configuration files for all applications, and also contains scripts to start and close a particular program, such as/etc/passwd,/etc/init.d/network.

/home/

Normal user home directory, the average user all the data stored in this directory

/mnt/

Mount Directory, mount point, system administrator can be used to temporarily mount the file system

/proc/

Display kernel and process information virtual file system

/sbin/

System binaries, commands in this directory are intended for use by system administrators for system maintenance. For example, Iptables, reboot, FDISK, etc.

/usr/

USR represents the Unix software source, and the default software is stored under the file

/var

is an extensible directory that contains very often variable files. For example,/var/log (System log),/var/lib (Pack documentation pieces)

3./etc/Catalogue

Directory

Describe

/etc/rc.d

is the location of BSD startup scripts, such as the definition of network cards, server open scripts, etc.

/etc/host

Local Domain name resolution file

/etc/sysconfig/network

Configuration of IP, mask, gateway, hostname, etc.

/etc/resolv.conf

DNS Configuration

/etc/fatab

Automatic mount system for boot

/etc/inittab

Set the init process to set the system to what runlevel and load the associated boot file configuration when the system starts

/etc/exports

Setting the configuration file path for NFS systems

/etc/profile

Global System Environment Configuration variables

/etc/bashrc Global environment variable Path

/etc/motd

String to display after login

/etc/issue

Pre-authentication login information, default output version kernel information

/etc/visudoes

Configuration files that can be Visudo

/etc/passwd Information about the account file
/etc/shadow Account password information file
/etc/group Related information files for user groups
/etc/gshadow Group Password information file
/etc/log Settings for log files

4./usr/Catalogue

Directory

Describe

/usr/bin/

Most of the users can use the instructions to put them here. Please note the difference between him and/bin. (whether it is related to the boot process)

/usr/include/

In the case of a file header (header) and a containing file (include) in a C + + program language, when we install some data in the Tarball Way (*.tar.gz), we use many of the included files inside.

/usr/lib/

A function library that contains the application software, the object file, and an executable file or script that is not commonly used by the user. Some software will provide some special instructions for the server settings, these instructions are not often operated by the system administrator, it will be placed in this directory. Note that if you are using a x86_64 Linux system, there may be/usr/lib64/directory generated

/usr/local/

The system administrator installs its own downloaded software (non-distribution default provider) natively, and recommends installing to this directory, which is easier to manage. For example, your distribution provides older software, you want to install newer software but do not want to remove the old version, you can install the new version of the software in the/usr/local/directory, can be different from the original version of the software. You can go to the/usr/local yourself to see, the directory is also has bin, etc, include, Lib ... The secondary directory

/usr/sbin/

System directives that are required for non-system normal operation. The most common is the service instructions for some Web server Software (daemon)

/usr/share/

Where the shared files are placed, the data placed in this directory is almost always readable by the hardware architecture, because it is almost a text file. These secondary directories are common in this directory:/usr/share/man: Online Help files

/usr/share/doc: Software Miscellaneous File description

/usr/share/zoneinfo: Time zone files associated with the time zone

/usr/src/

The general source code is suggested to be placed here, SRC has the meaning of source. The core source code is recommended to be placed in the/usr/src/linux/directory.

5./proc/Catalogue

Directory

Describe

/proc/cmdline

This file gives the kernel-initiated command line. It is very similar to the CmdLine item used for the process

/proc/cpuinfo

This file provides a variety of information about the system CPU

/proc/devices

This file lists the main device numbers for the character and block devices, and the device names assigned to those device numbers.

/proc/dma

This file lists the DMA channels reserved by the driver and the name of the driver that retains them. The Casade item is used for DMA lines that separate the secondary DMA controller from the main controller, and this line cannot be used for other purposes.

/proc/filesystems

This file lists the types of file systems that are available for use, one row for a type. Although they are typically a file system type that is programmed into the kernel, the file can also contain additional file system types that can be loaded by kernel modules.

/proc/interrupts

Each line of this file has a reserved interrupt. The fields in each row are: The interrupt number, the number of times the bank interrupt occurred, possibly the domain with a plus sign (sa_interrupt flag setting), and the name of the driver that registered the interrupt. You can manually view the file at hand with the Cat command before installing new hardware, like viewing/PROC/DMA and/proc/ioports. These files list the resources currently in use (but not those used by hardware that does not have drivers loaded).

/proc/ioports

This file lists many I/O port ranges registered by various device drivers such as disk drives, Ethernet cards, and sound card devices

/proc/meminfo This file gives information about the state of the memory. It shows the total amount of free memory, physical memory used, and swap memory in the system. It also shows the total amount of shared memory and buffers used by the kernel. The format of this information is similar to the result shown by the free command.
/proc/net The files in this directory describe or modify the behavior of the networked code. You can set or query many files in these special files by using the Arp,netstat,route and IPFWADM commands.
/proc/version This file has only one line of content that describes the kernel version that is running. You can use the standard programming method for analysis to obtain the required system information.
/proc/stat This file contains information about CPU utilization, disk, memory pages, swapping of memory, all interrupts, contact switches, and reward bootstrap time (seconds since January 1, 1970).

6./dev/Catalogue

Directory

Describe

/dev/null

Unlimited data reception devices, equivalent to black holes

/DEV/TTY[0-63]

Virtual Terminal

/DEV/TTYS[0-3]

Serial

/dev/console

Control Desk

/DEV/MD[0-31]

Soft RAID devices

7./var/Catalogue

Directory

Describe

/var/cache/

Some of the temporary archives that are generated during the operation of the application itself

/var/lib/

The program itself executes the process that needs to be used to place the data file in the directory. In this directory the respective software should have its own directory. For example, the MySQL database is placed in/var/lib/mysql/and the RPM database is put into/var/lib/rpm.

/var/lock/

Some devices or file resources can only be used by one application at a time, if there are two programs using the device, there may be some wrong situation, so it is necessary to lock the device (lock), to ensure that the device will only be used for a single software. For example, the recorder is burning a disc, do you think, there will be two people at the same time using a burner burning tablets? If two people were recording at the same time, whose data was written by that film? So when the first person is burning the burner is locked and the second person has to be unlocked (that is, the previous person ran out) to continue using

/var/log/

Very important. This is the directory where the login file is placed. There are more important documents such as/var/log/messages,/var/log/wtmp (log in information) and so on.

/var/mail/

The directory where the personal e-mail address is placed, but this directory is also placed in the/var/spool/mail/directory, usually the two directories are linked files.

/var/run/

When some programs or services start up, their PID is placed in this directory

/var/spool/

This directory usually places some queue data, so-called "queues" are data that is queued for use by other programs. This data is usually deleted after it is used. For example, the system receives a new letter that will be placed in the/var/spool/mail/, but the letter will be deleted in principle after the user has received the letter. If the letter is not sent out temporarily, it will be put into the/var/spool/mqueue/, and then deleted after being sent out. If it is work scheduling data (crontab), it will be placed in the/var/spool/cron/directory.

Linux system directory structure

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.