The role of each folder under Linux

Source: Internet
Author: User
Tags temporary file storage

Linux file structure to see what each folder is used for
/bin binary Executable command
/dev Device Special files
/etc system administration and configuration files
/ETC/RC.D startup configuration files and scripts
The base point of the home user directory, such as the user's home directory is/home/user, can be represented by ~user
/lib Standard Programming Library, also known as dynamic Link shared library, acts like a. dll file in Windows
/sbin System Management commands, which are stored in the hypervisor used by the system administrator
/tmp Common temporary file storage point
/root system Administrator's home directory (hehe, privileged Class)
The/MNT system provides this directory to allow users to temporarily mount other file systems.
/lost+found This directory is usually empty, the system is not properly shut down and leave the "homeless" files (what is called under Windows. chk) right here.
/proc a virtual directory, which is a mapping of system memory. This directory can be accessed directly to obtain system information.

/opt a directory of optional programs, such as the latest beta version of Firefox that I want to install, which can be placed here. Uninstall, delete that folder.
/var overflow area for some large files, such as log files for various services
/usr The largest directory, the applications and files to be used almost all in this directory. These include:
/USR/X11R6 the directory where x window is stored
/usr/bin a multitude of applications
/usr/sbin Some management programs for super users
/usr/doc Linux Documentation
/usr/include the header files needed to develop and compile applications under Linux
/usr/lib Common dynamic-link libraries and package profiles
/usr/man Help Documentation
/USR/SRC source code, the Linux kernel source is placed in the/usr/src/linux
/usr/local/bin Local Add-on command
/usr/local/lib local additions to the library

Here are the detailed functions of each folder

/etc File System
The/etc directory contains a variety of system configuration files, some of which are described below. Other you should know which one they belong to.
program, and read the program's M a n page. Many network configuration files are also in/etc.
1./ETC/RC or/etc/rc.d or/ETC/RC? D
A directory that starts, or alters, a script or script that runs at run-time.
2./etc/passwd
User database, where the domain gives the user name, real name, user start directory, encrypted password, and user's
His message.
3./ETC/FDPRM
A floppy disk parameter table that describes the different floppy disk formats. Can be set with SETFDPRM. For more information see S e t f D p R m
's help page.
4./etc/fstab
Specifies the list of file systems that need to be installed automatically at startup. Also includes information for the S W P zone enabled with Swapon-a.
5./etc/group
Similar to/etc/passwd, but not the user information but the group information. Includes various data for the group.
6./etc/inittab
The configuration file for init.
7./etc/issue
Includes the user's output information before the logon prompt. Usually includes a short description of the system or a welcome message. Specific internal
Determined by the system administrator.
8./etc/magic
"F i l E" configuration file. Contains a description of the different file formats, "F i l E" based on it guessing the file type.
9./ETC/MOTD
M o T D is the abbreviation for message of the day, and the user automatically outputs after successful login. The content is determined by the system administrator.
Often used to advertise information, such as warnings for scheduled shutdown times.
Ten./etc/mtab
List of currently installed file systems. Initialized by the script (s C r i t p) and updated automatically by the Mount command. When you need a
A list of currently installed file systems (for example, the DF command).
/etc/shadow.
Shadow password file on a system with shadow (s h a d o W) password software installed. Shadow password file will/E T c/p a s S W d
The encrypted password in the file is moved to the/E T C/s h a D o W and the latter is readable only by the superuser (R o o T). Which makes it more difficult to decipher the password
To increase the security of the system.
/etc/login.defs.
L o The configuration file for the G i n command.
/etc/printcap.
Similar to/etc/termcap, but for printers. syntax is different.
/etc/profile,/E t/C/s H. L o g i n,/ETC/CSH.CSHRC
Files executed at login or start b o u r n E or C shells. This allows the system administrator to establish a global default environment for all users.
/etc/securetty.
Confirm the security terminal, that is, which terminal allows Superuser (r o o T) to log in. The Virtual Console is generally listed so that it does not
It is possible (at least difficult) to break into the system via a modem (M o d e m) or network and gain superuser privileges.
/etc/shells.
Lists the S H e l l that can be used. The CHSH command allows the user to change the login's S H e L, within the scope specified in this file. Provide a
Machine f T P service process FTPD Check whether the user S H e l L is listed in the/etc/shells file, if not, will forbid
Allow the user to log on.
/etc/termcap.
Terminal Performance database. Describes what "escape sequence" controls are used by different terminals. No direct output escaping when writing programs
Sequence (this works only with a particular brand of terminal), but instead looks for the correct sequence of work to be done from/etc/termcap.
In this way, most programs can run on most terminals.


/dev File system
The/dev directory includes device files for all devices. The device file is named with a specific convention, which is described in the device list.
Device files are generated by the system during installation and can be described later with/dev/makedev. /d e v/m a k e d e v.local Yes
A descriptive document written by the system administrator for the local device file (or connection) (such as some non-standard device drivers are not standard
Part of the Makedev). Below is a brief introduction/d e v Some of the commonly used files.
1./dev/console
The system console, which is the monitor directly connected to the system.
2./dev/hd
I d e hard drive driver interface. such as:/d e v/h D a refers to the first hard drive, h a D 1 means/d e v/h D a the first
Partition. If there are other hard disks in the system, then the/d e v/h D B,/d e v/h D C 、...... If there are multiple partitions, in turn, the
H d A 1, h D a 2 ...
3./DEV/SD
s C S I disk driver interface. If the system has s C s I hard drive, it will not be accessed/d e v/h a D, but access/d e v/s D a.
4./dev/fd
Floppy drive device driver. such as:/d e v/F D 0 refers to the system's first floppy disk, which is usually said a: disk,
/d e v/F D 1 refers to the second floppy disk, ... The/d e v/F D 1 H 1 4 4 0 represents access to 1 in drive 4. 5 high-density disk.
5./dev/st
s C S I tape drive driver.
6./dev/tty
Provides Virtual Console support. such as:/d e v/t T y 1 refers to the system's first Virtual Console,/d e v/t T y 2 is the system
A second Virtual Console.
7./dev/pty
Provide remote login pseudo terminal support. The/d e v/p T y device is required to log in with Te L n e T.
8./dev/ttys
Computer serial interface, for D o S is the "C o M 1" port.
9./dev/cua
A computer serial interface, a device that is used with a modem.
Ten./dev/null
"Black hole," all the information written to the device disappears. For example, when you want to hide the output information on the screen
, simply enter the output information into the/d e v/n u l L.


/usr file system
/usr is a very important directory, usually this file system is very large, because all programs are installed here. In/usr
All files generally come from L i n u x release (d i s t r i b u t i o n); locally installed programs and other things under/usr/local, because this allows you to upgrade the new system or release without reinstalling all the programs. Many of the contents of the/usr directory are
Optional, but these features make it more efficient for users to use the system. /U S R can accommodate many large packages and their configurations
File. Some important directories are listed below (some of the less important directories have been omitted).
1./usr/x11r6
Contains all executable programs, configuration files, and supporting files for the x wi n d o w system. To simplify the development and installation of X,
X's files are not integrated into the system. The x wi n d o W system is a powerful graphical environment that provides a large number of graphics
Tool program. Users who are familiar with Microsoft WI n d o w s or m a c h i n t o S H will not be overwhelmed by the x wi n d o w system.
2./usr/x386
Similar/u s r/x 11r6, but is specifically for x one release 5.
3./usr/bin
Centralized almost all user commands, is the software library of the system. Some other commands are in/bin or/usr/local/bin.
4./usr/sbin
Includes unnecessary system administration commands for the root file system, such as most service programs.
5./usr/man,/U s r/i n f o,/u S r/d o C
These directories contain all manual pages, G-N u information documents, and various other document files. "section" for each online manual
There are two subdirectories. For example:/u S r/m a n/m a N 1 contains the source code for the first section of the online manual (original text without formatting
),/U S r/m a n/c a T 1 contains the contents of the first section that has been formatted. L The online manual is divided into the following nine sections: Internal command, System tuning
, library functions, devices, file formats, games, macro packages, System management, and core programs.
6./usr/include
Contains the header files of the C language, which are many. H to describe the data structure used in the C language program,
Child procedures and constants. In order to maintain consistency, this should actually be placed under the/usr/lib, but it is customary to use the name
Word.
7./usr/lib
Contains the immutable data file for the program or subsystem, including some s i t e-w i d e configuration files. Name L I b from library
(library); The original library of programming also exists in/usr/lib. When the program is compiled, the program connects to the library. Also
There are a number of programs that store configuration files.
8./usr/local
Locally installed software and other files are placed here. This is very similar to/U S R. The user may find some of the more significant
packages, such as T e X, E m a C s, and so on.


/var file system
/var contains data to be changed when the system is generally running. Usually the size of the directory in which the data resides is to change frequently
or expanded. Some contents of the original/V a R catalog are in/U S R, but in order to maintain the relative stability of the/U S R directory, the
The directories that need to be changed frequently are put in/V a R. Each system is specific, i.e. it is not shared with other computers over the network.
Some important directories are listed below (some of the less important directories are omitted).
1./var/catman
The formatted Help (m a N) page is included. The source file of the help page is generally present/U s r/m a n/m a n; some m a n pages
There may be a pre-formatted version that exists in/U S r/m a n/c a T. And the other m a N pages need to be formatted for the first time,
The formatted version exists in/var/man so that other people can look at the same page without waiting for formatting.
(/var/catman are often cleared, just as you would clear a temporary directory.) )
2./var/lib
The file to be changed when the system is in normal operation.
3./var/local
Variable data that holds the programs installed in the/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.
4./var/lock
Lock the file. Many programs follow the convention of creating a locked file in/var/lock to support their
Use a specific device or file. When other programs notice this lock file, you will no longer use this device or
Thing
5./var/log
Log of various programs (L o g) files, especially login (/var/log/wtmp log records to the system and note
and Syslog (/var/log/messages Records store all core and System program information). The files in/var/log are often not
Definite growth, should be cleaned up regularly.
6./var/run
Save the information file about the system that is valid before the next system boot. For example,/var/run/utmp contains the current login
The user's information is recorded.
7./var/spool
directory where the "spool (s P o L)" program is placed, such as M a I l, n e w s, print queue, and other queue working directory. Every
A different s P o L has its own subdirectory under/var/spool, for example, the user's mailbox is stored in/var/spool/mail.
8./var/tmp
Temporary files that are larger or require a longer time than/TMP are allowed.
Note system administrators may not allow/var/tmp to have very old files.


/proc File System
The/proc file system is a pseudo file system, which means that it is a directory that does not actually exist, so this is a
A very special directory. It does not exist on a disk, but is generated in memory by the core. This directory is used to raise
Information about the system. Here are some of the most important files and directories (the/proc file system has more detailed information on the proc man page
Detailed instructions).
1./proc/x
For the information directory of process X, this x is the identification number of this process. Each process under/proc has a name of self-
The directory of the process number.
2./proc/cpuinfo
Information about the processor (C p u), such as the type of C p u, manufacturer, model, and performance.
3./proc/devices
A list of device drivers for the currently running core configuration.
4./PROC/DMA
Displays the D m a channel currently in use.
5./proc/filesystems
The file system information for the core configuration.
6./proc/interrupts
Displays the information about the interrupt information and occupants that were occupied, and the amount that was consumed.
7./proc/ioports
The I/O port currently in use.
8./proc/kcore
System physical memory image. is exactly the same size as the physical memory, but it does not actually occupy so much memory;
It is created only when the program accesses it. (Note: Unless you copy it to a place,/proc does not have any
Anything that takes up any disk space. )
9./proc/kmsg
The message for the core output. will also be sent to S Y S l o G.
Ten./proc/ksyms
The core symbol table.
/proc/loadavg.
System "average load"; 3 meaningless indicators indicate the current workload of the system.
/proc/meminfo.
Various memory usage information, including physical memory and swap partition (s w a P).
/proc/modules.
Stores which core module information is currently loaded.
/proc/net.
Network protocol status information.
/proc/self.
A symbolic connection to the process directory that holds the program to view/proc. When 2 processes view/proc, this will be a different
The connection. This is primarily convenient for the program to get its own process directory.
/proc/stat.
The different states of the system, for example, the number of times a page error occurred after the system started.
/proc/uptime.
The length of time the system started.
/proc/version.
Core version.

Reprinted from Http://www.cnblogs.com/amboyna/archive/2008/02/16/1070474.html

and HTTP://HI.BAIDU.COM/TTXS5332264/ITEM/F77B28F4321E1D23743C4CCC

and http://www.hnsoftedu.com/News/software/News_429.html
This article from Csdn Blog, reproduced please indicate the source: http://blog.csdn.net/lonelysky/archive/2010/03/12/5374230.aspx

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.