Day eighth-detailed description of the Linux directory structure

Source: Internet
Author: User
Tags syslog

1. Tree-like structure directory diagram

[[Email protected]Yum. repos.d]# Tree-l1#根├──bin # executable binaries directory, such as common command ls, tar, MV, cat, etc. ├──boot # put some files used by Linux system startup. /boot/vmlinuz is the kernel file for Linux, as well as/boot/gurb. Recommended separate partition, partition size 100M can ├──cgroup├──dev # storage device files under the Linux system, access to a file in that directory, equivalent to access to a device, often mounted optical drive mount/dev/cdrom/mnt 。 ├──ETC # The directory where the system configuration files are stored, important profiles are/etc/inittab,/etc/fstab,/ETC/INIT.D,/etc/sysconfig,/ETC/XINETD.D before the configuration file is modified Have to be backed up.            ├──home # system Default User home directory, add user account, the user's home directory is stored in this directory , it is recommended to separate partition, and set a large disk space, convenient for users to store data ├──lib # The system uses the library directory, the program in the execution process, need to call some additional parameters when the function library to assist, compare the important directory for/lib/modules├──lib64├──lost+Found#当系统意外崩溃或机器意外关机 that will produce some file fragments here. When the system is booting up, the fsck tool checks here and repairs the corrupted file system. ├──media a mount point for a #可移除媒体 (such as a CD-ROM) ( appears in FHS-2.3 ). ├──misc├──mnt #临时 Mount the file system. such as cdrom,u disk, directly into the optical drive can not be used, to be mounted after use ├──net├──opt #Optional  application packages  ├──proc #This directory data is in memory, such as system core, external device, network status, because the data are stored in memory, so do not occupy disk space├──root #The system administrator root home directory, the system first boot partition is/, so it is best to put/root and//place under a partition. ├──sbin #Place executable commands that the system administrator uses, such as Fdisk, Shutdown, Mount, and so on. Unlike/bin, these directories are commands for the root of the system administrator, and the average user can only "view" and not be set up and used. ├──selinux├──srv #站点的具体 data , provided by the system. ├──SYS├──TMP #The directory where the files are temporarily stored by the general user or the program being executed, accessible to anyone, important data cannot be placed in this directory├──USR #Application storage directory,/usr/bin store application,/usr/share Store shared data,/usr/lib storage can not be directly run, but many programs are required to run a number of function library files.
| /usr/local: Storage software upgrade Package /usr/share/doc: system description file storage directory. /usr/share/man: Program description file storage directory
| when using the man LS, the content of the query/usr/share/man/man1/ls.1.gz is recommended to separate partitions, setting a larger disk space └──var #place files that change frequently during the execution of the system, such as log files that change at any time /var/log,/var/log/message: All the login files are stored in the directory

2./dev:Catalogue
DEV is the acronym for Devices. /dev This directory is important to all users. Because this directory contains all the external devices used in the Linux system. But this is not the driver for the external device, which is not the same as the Windows,dos operating system. It is actually a port that accesses these external devices. We can easily access these external devices, and access a file without any difference in a directory.
Linux inherits the Unix style, recognizing all devices as a file.
There are two types of device files: Block device file (b) and character device file (c)
The device files are generally stored in the/dev directory, and the common device files are described as follows:
/DEV/HD[A-T]: IDE Device
/DEV/SD[A-Z]: SCSI Device
/DEV/FD[0-7]: Standard floppy drive
/DEV/MD[0-31]: Soft RAID device
/DEV/LOOP[0-7]: Local loopback device
/DEV/RAM[0-15]: Memory
/dev/null: Unlimited data reception device, equivalent to black hole
/dev/zero: Unlimited 0 Resources
/DEV/TTY[0-63]: Virtual terminal
/DEV/TTYS[0-3]: Serial port
/DEV/LP[0-3]: the same port
/dev/console: Control Console
/DEV/FB[0-31]: framebuffer
/dev/cdrom =/dev/hdc
/dev/modem =/dev/ttys[0-9]
/dev/pilot =/dev/ttys[0-9]
/dev/random: Random number devices
/dev/urandom: Random number devices
(PS: Random number device, I will write a blog after the summary)
How are the nodes in the/dev directory created?
DEVF or Udev will automatically create it for you.
Kobject is the foundation of the Sysfs file system, and Udev acquires newly created devices by monitoring and detecting SYSFS.

3./etc: Directory
Contains many files. Many network configuration files are also in/etc.
/ETC/RC or/etc/rc.d or/etc/rc*.dThe directory of scripts or scripts that is running when the run level is started, or changed.
/etc/passwdUser database, where the domain gives the user name, real name, home directory, encrypted password, and other information of the user.
/etc/fstabA list of file systems that automatically mount the mount-a command (in/ETC/RC or equivalent startup file) at startup. Linux, also includes information about the swap area enabled with SWAPON-A.
/etc/groupSimilar to/etc/passwd, but not the user but the group.
/etc/inittabThe configuration file for init.
/etc/issueGetty the output information before the logon prompt. Usually includes a short description of the system or welcome information. The content is determined by the system administrator.
/ETC/MOTDMessage of the day, automatic output after successful login. The content is determined by the system administrator. Often used to advertise information, such as a warning to schedule shutdown time.
/etc/mtabList of currently installed file systems. Initialized by scripts and updated automatically by the Mount command. A list of currently installed file systems is required, such as the DF command.
/etc/shadowThe shadow password file on the system on which the shadow password software is installed. The shadow password file moves the encrypted password in the/etc/passwd file to/etc/shadow, which is only readable by the root. This makes it more difficult to decipher the password.
/etc/login.defsThe configuration file for the login command.
/etc/printcapSimilar to/etc/termcap, but for printers. syntax is different.
/etc/profile,/etc/csh.login,/ETC/CSH.CSHRCThe file that is executed by Bourne or C shells at logon or startup. This allows the system administrator to establish a global default environment for all users.
/etc/securettyConfirm the security terminal, that is, which terminal allows root login. Typically only virtual consoles are listed, which makes it impossible (at least difficult) to break into the system via modem or network and gain superuser privileges.
/etc/shellsThe list of trusted SHELL.CHSH commands allows the user to change the login shell within the scope specified in this file. Provides a service process for a machine FTP service FTPD checks whether the user shell is listed in the/etc/shells file, if the user is not allowed to log on.
/etc/sysconfigNetwork Configuration Related Directory

   /etc/hostsLocal Domain name resolution file
   /etc/sysconfig/networkIP, mask, Gateway, host name configuration
   /etc/resolv.confDNS server Configuration
   /etc/exportsSetting the configuration file path for NFS systems
   /etc/sudoersConfiguration files that can be sudo commands
   /etc/syslog.confSystem Log Parameter Configuration
   /etc/x11/Configuration file for X_window system (version 11)
   /etc/skel/When creating a user by default, copy the directory to the home directory

4./proc: Directory
File Name files Contents
/proc/cmdlineThe relevant parameters released when loading kernel! Check out this file to see how the system started!
/proc/cpuinfoInformation about the CPU of this machine, including the time pulse, type and arithmetic function, etc.
/proc/devicesThis document records the main device code for each major device in the system, which is related to Mknod.
/proc/filesystemsCurrently the system has been loaded by the file system ROM!
/proc/interruptsCurrent IRQ assignment status above the system.
/proc/ioportsThe I/O addresses configured on each of the devices above the current system.
/proc/kcoreThis is the size of the memory! It's so big, right? But don't read him!
/proc/loadavgDo you remember top and uptime? That's right! The top three average values are recorded here!
/proc/meminfoUse free to list the memory information, hehe! You can also check it here!
/proc/modulesCurrently our Linux has loaded the list of modules can also be thought of as a driver!
/proc/mountsThe data that has been mounted by the system is the data that is called with the Mount command!
/proc/swapsWhat is the memory where the system hangs and loads? Oh! The use of the partition is recorded here!
/proc/partitionsUsing Fdisk-l will show all the partition right now? There is also a record in this document Oh!
/proc/pciOn the PCI bus top, the details of each device! Lspci can be used to check!
/proc/uptimeis to use uptime time, will appear the information!
/proc/versionThe core version is the content displayed with Uname-a!
/proc/bus/*Some bus-line devices, as well as a U disk device is also recorded here Oh!

5./usr: directory
The/usr file system is often large because all programs are installed here. All files in/usr typically come from Linux distribution, locally installed programs, and other things under/usr/local. This may not require reinstalling all programs when upgrading a new system or distribution.
/usr/etcStoring settings files
/usr/gamesStore games and teaching documents
/usr/includeThe header file that holds the C development tool
/usr/shareStoring structure-independent data
/usr/binAlmost all user commands. Some commands are in/bin or/usr/local/bin.
/usr/sbinRoot file system unnecessary system administration commands, such as most service programs.
/usr/share/man,/usr/share/info,/usr/share/docManual pages, GNU information documents, and various other documentation files.
/usr/includeThe header file for the C programming language. In order to be consistent this should actually be under/usr/lib, but it is traditionally supported by this name.
/usr/libAn unchanging data file for a program or subsystem, including some site-wide configuration files. The name Lib originates from the library; The original inventory of the programming is in/usr/lib.
/usr/localLocally installed software and other files are placed here.
/usr/srcSource code of the stored program

6./var: directory
/var includes data to be changed when the system is generally running. Each system is specific, i.e. it is not shared with other computers over the network.
/var/catman
The source file of the Cache.man page of the man page when the format is required is generally present in/usr/man/man*; some man pages may have a pre-formatted version in/usr/man/cat*. While the other man pages need to be formatted for the first time, the formatted version exists/ Var/man, so that other people look at the same page without having to wait for formatting. (/var/catman are often cleared, just as the temporary directory is cleared.)
/var/lib
The file to be changed when the system is running normally.
/var/local
Variable data for programs installed in/usr/local (that is, programs installed by the system administrator). Note that if necessary, even locally installed programs use other/var directories, such as/var/lock.
/var/lock
Lock the file. Many programs follow the convention of creating a locked file in/var/lock to support their use of a particular device or file. Other programs Note that this lock file will not attempt to use this device or file.
/var/log

Log files for various programs, in particular login (/var/log/wtmp log all to system log-in and logoff) and syslog (/var/log/messages store all core and System program information.) The files in the/var/log are constantly growing in uncertainty, Should be cleaned up regularly.
/var/run

The information file that is valid for the system before the next boot. For example,/var/run/utmp contains information about the user who is currently logged on.
/var/spool
Directories for mail, news, print queues, and other queues. Each of the different spool has its own subdirectory under/var/spool, for example, the user's mailbox is in/var/spool/mail.
/var/tmp

Temporary files that are larger or need to exist longer than/tmp. (Although the system administrator may not allow/var/tmp to have very old files.)

This article references: http://www.iteye.com/topic/1125162

This article references: http://yangrong.blog.51cto.com/6945369/1288072

Day eighth-detailed description of the Linux 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.