Linux directory structure detailed description

Source: Internet
Author: User
Tags documentation syslog system log

Directory
1. Tree-like directory structure diagram
2./catalogue
3./etc/Catalogue
4./usr/Catalogue
5./var/Catalogue
6./proc/Catalogue
7./dev/Catalogue

This article mainly comes from the network to organize.
Directory Structure Reference address:
http://www.hudong.com/wiki/linux%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84
Http://linux.ccidnet.com/art/3067/20070315/1037337_1.html
Http://os.51cto.com/art/200802/65783.htm
http://www.iteye.com/topic/1125162

2./catalogue

Directory
Describe
/
The root of the first hierarchy, the root of the entire file system hierarchy.
/bin/
Required commands (executables) that are available in single-user mode, for all users, such as cat, LS, CP, and/usr/bin.
/boot/
Bootstrapper files, for example: kernel, initrd; often a separate partition [6]
/dev/
necessary equipment, for example:,/dev/null.
/etc/
A system-wide configuration file for a specific host.
There is currently a controversy about this name. At Bell Labs in earlier versions of the UNIX implementation documentation,/etc is referred to as the/etcetra directory, [7] This is due to the fact that in the past this directory holds all things that are not elsewhere (however, FHS restricts/etc to store static configuration files and cannot contain binaries). [8] Since the early publication of the document, the catalog name has been re-styled in various ways. Recent explanations include reverse abbreviations such as "Editable text configuration" (English "Editable text config") or "Extended toolbox" (English "Extended tool Chest"). [9]
/etc/opt/
Configuration file for/opt/
/etc/x11/
Configuration file for X_window system (version 11)
/etc/sgml/
Configuration files for SGML
/etc/xml/
Configuration file for XML
/home/
The user's home directory, which contains saved files, personal settings, etc., is generally a separate partition.
/lib/
/bin/and/sbin/the necessary library files for binary files.
/media/
A mount point that removes media (such as CD-ROM), which appears in FHS-2.3.
/lost+found
In the Ext3 file system, when the system crashes unexpectedly or the machine shuts down unexpectedly, some file fragments are generated here. When the system is booting up, the fsck tool checks here and repairs the corrupted file system. When a problem occurs on the system. There may be files that are moved to this directory and may need to be repaired manually or moved to the original location of the file.
/mnt/
The file system that is temporarily mounted. such as Cdrom,u disk, directly into the optical drive can not be used, to be mounted after use
/opt/
Optional application package.
/proc/
A virtual file system that archives the kernel and process state as a text file (System information is stored in this directory). For example: uptime, network. In Linux, the corresponding PROCFS format is mounted. Files in this directory can only be viewed and cannot be changed (including root)
/root/
Home directory for super users
/sbin/
necessary system binaries, such as: Init, IP, mount. Sbin the command under the directory, ordinary users can not execute.
/srv/
The specific data of the site, provided by the system.
/tmp/
Temporary files (see/VAR/TMP), files in the directory are not retained when the system restarts.
/usr/
The default software will be stored in this directory. The second level for storing read-only user data, including most (many) user tools and applications.
/var/
Variable files--files whose contents are constantly changing in a functioning system, such as logs, Offline files, and temporary e-mail files. Sometimes it is a separate partition. If you do not partition separately, you may be able to fill the entire partition. If separate partition, give big to small not appropriate.
3./etc/Catalogue
A specific host system-wide configuration file.

Directory
Describe
/etc/rc/etc/rc.d
/etc/rc*.d
The directory of scripts or scripts that is running when the run level is started, or changed.
/etc/hosts
Local Domain name resolution file
/etc/sysconfig/network
IP, mask, Gateway, host name configuration
/etc/resolv.conf
DNS server Configuration
/etc/fstab
Automatic mount system, all partitions will be automatically mounted on boot
/etc/inittab
Sets how the INIT process will set the system to runlevel and load the associated boot file configuration when the system starts
/etc/exports
Setting the configuration file path for NFS systems
/etc/init.d
This directory to hold the system startup script
/etc/profile,/etc/csh.login,/ETC/CSH.CSHRC
Global System Environment Configuration variables
/etc/issue
Pre-authentication output information, default output version kernel information
/etc/motd
Set the output information after authentication,
/etc/mtab
The list of file systems currently installed. Initialized by scripts and updated automatically by the Mount command. When you need a list of currently installed file systems, such as the DF command
/etc/group
Similar to/etc/passwd, but not the user but the group.
/etc/passwd
User database, where the domain gives the user name, real name, home directory, encrypted password, and other information of the user.
/etc/shadow
The 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/sudoers
Configuration files that can be sudo commands
/etc/syslog.conf
System Log Parameter Configuration
/etc/login.defs
Set up files for user account restrictions
/etc/securetty
Confirm 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/printcap
Similar to/etc/termcap, but for printers. syntax is different.
/etc/shells
The 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/xinetd.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. Available in the newer version of Redhat Fedora.
/etc/opt/
Configuration file for/opt/
/etc/x11/
Configuration file for X_window system (version 11)
/etc/sgml/
Configuration files for SGML
/etc/xml/
Configuration file for XML
/etc/skel/
When creating a user by default, copy the directory to the home directory


4./usr/Catalogue
The default software will be stored in this directory. The second level for storing read-only user data, including the vast majority of user tools and applications.
Directory
Describe
/usr/x11r6
A directory for storing x-windows;
/usr/games
Store the small game that xteamlinux comes with;
/usr/doc
Linux technical documentation;
/usr/include
Used to store the header files needed to develop and compile applications under Linux;
/usr/lib
Store some common dynamic link shared libraries and static archives;
/usr/man
The directory where the Help document resides;
/usr/src
Linux Open source Code, there is this directory, enthusiasts do not let go oh;
/usr/bin/
Non-essential executables (not required in single-user mode), for all users.
/usr/lib/
/usr/bin/and/usr/sbin/libraries for binary files.
/usr/sbin/
Non-essential system binaries, such as: The daemon of a large number of network services.
/usr/share/
Architecture-Independent (shared) data.
/usr/src/
Source code, such as: Kernel source code and its header file.
/usr/x11r6/
X Window System version one, release 6.
/usr/local/
The third level of local data, specific to the host computer. In general, there are further subdirectories, such as: bin/, lib/, share/. This is the/USR directory provided to the general user, where the general application software is installed;


5./var/Catalogue
/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.

Directory
describes
/var/log/message
log information, automatic polling by week
/var/spool/cron/root
Timer profile directory, default by user name
/var/log/secure
Record the log in system access information files, regardless of authentication success or authentication failure will be recorded
/var/log/wtmp
Log The login information file, last,who,w command information from the source of this
/var/spool/ clientmqueue/
When the mail service is not turned on, all messages that should be sent to the system administrator will be stacked in this
/var/spool/mail/
Mail directory
/var/tmp
than/tmp Temporary files that are allowed to be large or need to exist for a longer period of time. (Although the system administrator may not allow/var/tmp to have very old files.) Files to be changed when the
/var/lib
System is running correctly. Variable data for programs installed in
/var/local
/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
Locks 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, especially login (/var/log/wtmp log all to system log-in and logoff) and syslog (/var/log/messages store all core and System program information./var/log Files often grow in uncertainty and should be cleaned up regularly.
/var/run
Saves the information file about the system that is valid until the next boot. For example,/var/run/utmp contains information about the user who is currently logged on.
/var/cache/The
application caches data. This data is a time-consuming I/O or calculation result that is generated locally. The application must be able to regenerate or restore data. Cached files can be deleted without causing data loss.


6,/proc/directory
Virtual file system, the kernel and process status archived to a text file (System information is stored in this directory).
For example: uptime, network. In Linux, the corresponding PROCFS format is mounted. Files in this directory can only be viewed (including root)
Directory
Description
/proc/meminfo
View memory information
/proc/loadavg
Remember top and uptime? That's right! The top three average values are recorded here!
/proc/uptime
is the information that will appear when you use uptime.
/proc/cpuinfo
Information about the processor, such as type, manufacturer, model, and performance.
/proc/cmdline
The relevant parameters released when loading kernel! Check out this file to see how the system started!
/proc/filesystems
The file system that is currently loaded on the system ROM!
/proc/interrupts
The IRQ assignment status above the current system.
/proc/ioports
is the I/O address configured on each appliance on the system.
/proc/kcore
This is the size of the memory! It's so big, right? But don't read him!
/proc/modules
The list of modules that our Linux has already loaded can also be thought of as drivers! The data that is already mounted on the
/proc/mounts
System is the data that is called with the Mount command!
/proc/swaps
Where is the memory that the system hangs loaded? Oh! The use of the partition is recorded here!
/proc/partitions
Using fdisk-l will all the current partition appear? There is also a record in this document Oh!
/proc/pci
on the PCI bus bar, details of each device! Lspci can be used to check! The version of
/proc/version
Core is the content displayed with Uname-a!
/proc/bus/*
Some of the bus devices, as well as the USB stick device is also recorded here Oh!


7./dev/Catalogue
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,
The common device files are described as follows:

Directory
Describe
/DEV/HD[A-T]
IDE Device
/DEV/SD[A-Z]
SCSI devices
/DEV/FD[0-7]
Standard Floppy Drive
/DEV/MD[0-31]
Soft RAID devices
/DEV/LOOP[0-7]
Local loopback device
/DEV/RAM[0-15]
Memory
/dev/null
Unlimited data reception devices, equivalent to black holes
/dev/zero
Unlimited 0 Resources
/DEV/TTY[0-63]
Virtual Terminal
/DEV/TTYS[0-3]
Serial
/DEV/LP[0-3]
and the port
/dev/console
Control Desk
/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

Linux directory structure detailed description

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.