Description of the structure and application of the folders under Linux

Source: Internet
Author: User
Tags syslog temporary file storage ide hard drive

Linux under each document Clamp of the Knot structure say Ming and uses Shaoxing :

/bin:Binary executable command.
/ Dev:Device special files.
/ etc:System administration and configuration files.
/ETC/RC.D:Start the configuration files and scripts.
/Home:The base point of the user's home directory, such as the user's home directory is/home/user, can be represented by ~user.
/lib:The standard programming library, also called dynamic Link shared library, acts like a. dll file in Windows.
/sbin:System administration commands, which are stored in the hypervisor used by the system administrator.
/ tmp:A common temporary file storage point.
/root:The system administrator's home directory.
/mnt:The 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" file is here.
/proc:A virtual directory, which is a mapping of system memory. This directory can be accessed directly to obtain system information.
/ var:Overflow zones 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.which contains:
/USR/X11R6:The directory where the 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 required to develop and compile the application under Linux.
/usr/lib:Configuration files for commonly used dynamic-link libraries and packages.
/usr/man:Help documentation.
/usr/src:Source code, the Linux kernel code is placed in the/usr/src/linux.
/usr/local/bin:The locally added command.
/usr/local/lib:The locally added Coogan file system.

Typically, the root filesystem occupies a smaller space because most of the files do not need to be changed frequently, and include strict files and a small, infrequently changed file system that cannot be easily damaged. Except for a possible one called/vmlinuzIn addition to the standard system boot image, the root directory generally does not contain any files. All other files are in subdirectories of the root file system.
1./binMeshRecord
/binThe directory contains the commands required to boot or the commands that a normal user might use (possibly after boot boot). These commands are binary executable programs (the bin is the binary abbreviation), most of the system is important system files.
2./sbinMeshRecord
/sbinDirectory Similar/bin, which is also used to store binary files. Since most of these files are the basic system programs used by the system administrator, they are generally not used by ordinary users, although they can be used when necessary and permissible.
3./etcMeshRecord
/ etcThe directory contains a variety of system configuration files, including user information files/etc/passwd, the system initialization file/ETC/RCsuch as Linux relies on these files to run normally.
4./rootMeshRecord
The/root directory is the Super User directory.
5./libMeshRecord
/libA directory is a shared library required by a program on the root file system that holds the shared files required for the root file system program to run. These files contain code that can be shared by many programs to prevent each program from having a copy of the same subroutine, making the executable smaller and space-saving.
6./lib/modulesMeshRecord
/lib/modulesThe directory contains system cores that can load various modules, especially those needed to reboot the system when recovering a damaged system (for example, network and file system drivers).
7./devMeshRecord
/ DevThe directory holds device files, or device drivers, through which users access external devices. For example, users can access/dev/mouseTo access the mouse's input, just like accessing other files.
8./tmpMeshRecord
/ tmpThe information and data generated by the directory store program at run time. But after booting, the program that runs is best used/var/tmpTo replace/ tmp, because the former may have a larger disk space.
9./BootMeshRecord
/ BootThe directory holds the files used by the boot loader (bootstrap loader), such as Lilo, and the core image is often placed here, rather than in the root directory. But if there are many core images, this directory can become very large, and it would be better to use a separate file system. It is also important to note that the core image must be within the first 1024 cylinders of the IDE's hard disk.
Ten./mntMeshRecord
/mntThe directory is the installation point of the system Administrator temporary installation (mount) file system. The program does not automatically support installation to/mnt/mntThe following can be broken down into many subdirectories, such as/mnt/dosaMay be a floppy drive using the Msdos file system, while/mnt/extaMay be a floppy drive using the Ext2 file system,/mnt/cdromOptical drive and so on.
/proc,/usr,/var, /HomeMeshRecord
Installation point for other file systems.

The directory tree can be divided into small sections, each of which can be on its own disk or partition. The main sections are the root,/usr,/var, and/home file systems. Each part has a different purpose.
Each machine has a root file system that contains the files necessary to boot the system and enable other file systems to mount, and the root filesystem should have enough content for a single-user state. It should also include tools to repair damaged systems, restore backups, and so on.
The/usr file system contains all the commands, libraries, man pages, and other non-changing files that are required in general operations. /usr should not have a file to be modified in general use. This allows the files in this file system to be shared over the network, which can be more efficient because it saves disk space (/usr is easily hundreds of trillion) and is easy to manage (when upgrading an application, only the primary/USR needs to be changed without changing each machine) even if the file system is on a local disk, You can also read mount only to reduce file system corruption when the system crashes.
The/var file system contains files that change, such as the spool directory (for Mail, news, printers, and so on), log files, formatted manual pages, and staging files. Traditionally,/var has been somewhere in/usr, but it is not possible for/USR to be read-only installed.
The/home file system contains all of the actual data on the system, including the user House directory. A large home/home may be divided into a number of file systems, you need to add a class name under/home, such as/home/students,/home/staff and so on.

Here is a detailed description:
/ etcFile SystemIntegration
/ etcThe directory contains various system configuration files, some of which are described below. Other you should know which program they belong to and read the man page of the program. Many network configuration files are also in/etc.
1./ETC/RCor/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 other information for the user.
3./ETC/FDPRM:A floppy disk parameter table that describes the different floppy disk formats. Can be set with SETFDPRM. See the SETFDPRM help page for more information.
4./etc/fstab:Specifies the list of file systems that need to be installed automatically at startup. Also includes information about the swap area enabled with SWAPON-A.
5./etc/group:Similar/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 content is determined by the system administrator.
8./etc/magic:The configuration file for "file". Contains a description of the different file formats, and "file" guesses the file type based on it.
9./ETC/MOTD:MOTD is the message of the day, which is automatically exported after the user has successfully logged in. The content is determined by the system administrator.
Often used to advertise information, such as warnings for scheduled shutdown times.
10./etc/mtab:List of currently installed file systems. Initialized by the script (SCRITP) and updated automatically by the Mount command. Used when a list of currently installed file systems is required (for example, the DF command).
/etc/shadow.:The shadow password file on the system on which the Shadow (shadow) password software is installed. The shadow password file moves the encrypted password in the/etc/passwd file to/etc/shadow, which is readable only by the superuser (root). This makes it more difficult to decipher the password, which increases the security of the system.
/etc/login.defs.:The configuration file for the login command.
13./etc/printcap:Similar to/etc/termcap, but for printers. syntax is different.
/etc/profile.,/etc/csh.login,/ETC/CSH.CSHRC:Files that are executed by Bourne or Cshells at logon or startup. This allows the system administrator to establish a global default environment for all users.
15./etc/securetty:Confirm the security terminal, that is, which terminal allows superuser (root) to log in. Only virtual consoles are generally listed, which makes it impossible (at least difficult) to break into the system via a modem or network and gain superuser privileges.
/etc/shells.:Lists the shells you can use. The CHSH command allows the user to change the login shell within the scope specified in this file. Provide a
Machine FTP Service process FTPD Check that the user shell is listed in the/etc/shellsFile, if it is not, the user will not be allowed 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
Series (This works only on a specific brand of terminal), but/etc/termcapTo find the correct sequence of work to do. In this way, most programs can run on most terminals.


/ DevFile SystemIntegration
/ Dev
The 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 at the time of installation and can be used later/dev/makedevDescribe. /dev/makedev.local is a descriptive document written by the system administrator for local device files (or connections) (such as some non-standard device drivers that are not part of the standard Makedev). Below is a brief introduction/ DevSome of the common files.
1./dev/console:The system console, which is the monitor directly connected to the system.
2./DEV/HD:IDE hard drive driver interface. such as:/dev/hda refers to the first hard disk, had1 refers to the/dev/hdaThe first partition. If there are other hard disks in the system, click/dev/hdb,/dev/hdc 、......; If there are multiple partitions then hda1, hda2 ...
3./DEV/SD:SCSI disk driver interface. If the system has a SCSI hard disk, it will not be accessed/dev/had, and will access/DEV/SDA
4./dev/fd:Floppy drive device driver. Such as:/dev/fd0Refers to the first floppy disk of the system, which is usually called a,/dev/fd1Refers to a second floppy disk, ... and/dev/fd1h1440Indicates access to the 4.5 high-density disk in drive 1.
5./dev/st:SCSI tape drive drivers.
6./dev/tty:Provides Virtual Console support. Such as:/dev/tty1Refers to the first Virtual console of a system,/dev/tty2Is the system
A second Virtual Console.
7./dev/pty:Provide remote login pseudo terminal support. When you log in with Telnet, you need to use/dev/ptyEquipment
8./dev/ttys:Computer serial interface, for DOS is "COM1" port.
9./dev/cua:A computer serial interface, a device that is used with a modem.
10./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/dev/null.


/ usrFile SystemIntegration
/ usris a very important directory, usually this file system is very large, because all programs are installed here./ usrUsually comes from Linux distributions, locally installed programs and other things in/usr/local, because this allows you to upgrade the new system or release without reinstalling all of the programs. Many of the content in the/usr directory is optional, but these features make it more efficient for users to use the system. /usr can accommodate many large packages and their configuration files. 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 Window System. To simplify the development and installation of x, files for x are not integrated into the system. The X Window System is a powerful graphical environment that provides a large number of graphical tool programs. Users who are familiar with Microsoft Windows will not be overwhelmed by the X Window System.
2./usr/x386:Similar/USR/X11R6, but is specifically for X 5 release.
3./usr/bin:Centralized almost all user commands, is the software library of the system. Some other commands are/binOr/usr/local/binIn
4./usr/sbin:Includes unnecessary system administration commands for the root file system, such as most service programs.
5./usr/man,/usr/info,/usr/doc:These directories contain all manual pages, GNU information documents, and various other documentation files. Each online manual has two subdirectories for the section. For example:/usr/man/man1 contains the source code for the first section of the online manual (no formatted original file),/USR/MAN/CAT1 contains the first section of the formatted content. The online manual is divided into the following nine sections: internal commands, system calls, library functions, devices, file formats, games, macro packages, system administration, and core programs.
6./usr/include:Contains the C language header files, which end in. h to describe the data structures used in the C language program,
Child procedures and constants. In order to maintain consistency, this should actually be placed in/usr/lib, but it's customary to use the name.
7./usr/lib:Contains the immutable data files for the program or subsystem, including some site-wide configuration files. The name Lib originates from the library; The original library of programming also exists/usr/libIn When the program is compiled, the program connects to the library. There are also a number of programs that store configuration files.
8./usr/local:Locally installed software and other files are placed here. This is similar to/usr. The user may find some of the more significant
Packages, such as Tex, Emacs, and so on.

/ varFile SystemIntegration
/ varContains data to be changed when the system is generally running. Usually the size of the directory in which the data resides is constantly changing or expanding. In the original/var directory, some of the content is in/usr, but in order to maintain the relative stability of the/USR directory, the directories that need to change frequently are placed in/var. 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 (man) page is included. The source file for the help page is generally present in/usr/man/catman, and some man pages may have a pre-formatted version, which exists in/usr/man/cat. While the other man 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/catmanis often cleared, just like clearing a temporary directory. )
2./var/lib:The file to be changed when the system is in normal operation.
3./var/local:Stored/usr/localVariable data for programs installed in (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/var/lockA lock file is created to support the
Use a specific device or file. Other programs will not use this device or file when they notice the lock file.
5./var/log:Logs (log) files for various programs, especially login (/var/log/wtmplogLog all login and logoff to the system) and syslog (/var/log/messagesRecords store all core and System program information). The files in the/var/log often grow in uncertainty and 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/utmpContains information about the user who is currently logged on.
7./var/spool:A directory that places "spool (spool)" programs, such as Mail, news, print queues, and other queues that work. Every
A different spool 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.

/procFile SystemIntegration
/procThe file system is a pseudo file system, which means that it is a directory that does not actually exist, so this is a very special directory. It does not exist on a disk, but is generated in memory by the core. This directory is used to provide information about the system. Here are some of the most important files and directories (the/proc file system is described in more detail in the proc man page).
1./proc/x:The information directory for process X, which is the identification number for this process. Each process has a directory called its own process number under/proc.
2./proc/cpuinfo:Store processor (CPU) information, such as the type of CPU, manufacturer, model, and performance.
3./proc/devices:A list of device drivers for the currently running core configuration.
4./PROC/DMA:Displays the DMA 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 somewhere, there's nothing in the/proc that takes up any disk space.) )
9./proc/kmsg:The message for the core output. will also be sent to the syslog.
10./proc/ksyms:The core symbol table.
11./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 (swap).
13./proc/modules:Stores which core module information is currently loaded.
14./proc/net:Network protocol status information.
15./proc/self:Store to view/procA symbolic connection of the program's process directory. When 2 processes are viewed/procWhen this is going to be different
The connection. This is primarily convenient for the program to get its own process directory.
16./proc/stat:The different states of the system, for example, the number of times a page error occurred after the system started.
17./proc/uptime:The length of time the system started.
/proc/version.:Core version.

/usr/local is usually the directory where you install the software, this directory is equivalent to the Windows under the Programefiles this directory  

/opt This directory is the installation directory of some large software, or the installation directory of some service programs

For example: The beta version just loaded Firefox , it can be loaded into /opt/firefox_beta directory, /opt/firefox_beta The directory below contains the running Firefox all the files, libraries, data, etc. that are needed. To remove Firefox , you can simply delete the /opt/firefox_beta directory.

/usr/local

This iswhere most manually installed (ie outside of your package manager) Softwaregoes. It has the same structure as/usr. It's a good idea to leave/usr Toyour Package Manager and put any custom scripts and things into/usr/local,since Nothing Important normally lives in/usr/local.

/usr/local

The main store is the manually installed software, which is not through the "new" or Apt-get Install the software. It has a similar directory structure to the/usr directory. Let the package Manager manage the/ usr directory and put the custom script (scripts) under the /usr/local directory. I think this should be a good idea.

Description of the structure and application of the folders under Linux

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.