The role of Linux directories

Source: Internet
Author: User
Tags syslog system log ide hard drive

1./bin Catalogue

The bin is an abbreviation for binary (binary). This directory inherits the structure of the UNIX system and stores the binary executable commands most often used by the user. such as CP, LS, cat, and so on.

2./Boot Directory

Here are some of the core files used when starting Linux. /Boot 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 I-D e-drive.

3./Dev Directory

Dev is the abbreviation for device (devices). This directory is an external device file (that is, device driver) for all Linux, which functions like. SYS under DOS and. VxD under win. In Linux, devices and files are accessed in the same way. For example:/dev/hda represents the first physical IDE hard disk.

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. /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).

(1) /dev/console system console, which is a direct and system connected monitor.

(2) /DEV/HD IDE hard drive driver interface. such as:/dev/hda refers to the first hard disk, had1 refers to the first partition of/dev/hda . If there are other hard disks in the system, then/dev/hdb,/dev/hdc 、... If more than one partition is hda1, Hda2 ...

(3) /dev/sd  SCSI Disk driver interface. If the system has a SCSI hard disk, it will not access the/DEV/HDA, but will access the/DEV/SDA.

(4) /dev/fd    floppy drive device driver. such as:/dev/fd0 refers to the system's first floppy disk, which is usually said a: disk,/dev/fd1 refers to the second floppy disk, ... The/dev/fd1 h1440, however, represents access to drive 1 in 4. 5 high-density disk.

(5) /dev/st  SCSI tape drive driver.

(6) /dev/tty    provides Virtual Console support. such as:/dev/tty1 refers to the system's first Virtual Console,/dev/tty2 is the system 's second Virtual Console.

(7) /dev/pty    provides remote login pseudo terminal support. The/dev/pty device is used for Telnet login.

(8) /dev/ttys    Computer serial interface, for DOS is "COM1" mouth.

(9) /dev/cua    Computer serial interface, the device used with the modem.

(Ten) /dev/null "black hole", all information written to the device will disappear. For example: When you want to hide the output information on the screen , simply enter the output information into/dev/null.

4./etc Directory

Store the configuration files and subdirectories required for system administration.

(1) /etc/rc or /etc/rc.d or /ETC/RC? D A directory that starts, or alters, a configuration file, 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, encryption password and other information of the user.

(3) /ETC/FDPRM floppy disk parameter table to illustrate 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 for the S W P zone enabled with Swapon-a.

(5) /etc/group is similar to/etc/passwd, but it does not describe user information but group information. Includes various data for the group.

(6) /etc/inittab init configuration file.

(7) /etc/issue includes the user's output information before the login prompt. Usually includes a short description of the system or a welcome message. Specific content is determined by the system administrator.

(8) /etc/magic "file" configuration file. Contains a description of the different file formats, and "file" guesses the file type based on it.

(9) /ETC/MOTD MOTD is an abbreviation for 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.

/etc/mtab The 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).

(one) /etc/shadow The shadow password file on the system where 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.

( /etc/printcap ) similar to/etc/termcap, but for printers. syntax is different.

/etc/profile ,/etc/csh.login,/etc/csh.cshrc Log on or start with Bourne or C shells executed files. 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 (root) login. 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. A service process that provides a machine FTP service FTPD checks whether the user shell is listed in the/etc/shells file, and if 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. Instead of outputting the escape sequence directly (so that it works only with a particular brand of terminal), the program looks for the correct sequence of work to be done from/etc/termcap. In this way, most programs can run on most terminals.

5. /home Directory

The user's home directory, such as a user named Wang, his home directory is/home/wang can also be expressed in ~wang.

6./lib Catalogue

This directory contains the system's most basic dynamic link sharing library, which acts like a. dll file in Windows. These shared libraries are required for almost all applications.

  The /lib/modules 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,/lost+found

This directory is usually empty, and when the system shuts down, it becomes a refuge for homeless files. Yes, a bit like the. chk file under DOS.

8./mnt Catalogue

This directory is empty and the system provides this directory to let users temporarily mount other file systems.

9./proc Catalogue

This is a virtual directory, it is a mapping of system memory, through direct access to this directory can obtain system information. It does not exist on a disk, but is generated in memory by the core, meaning that the contents of this directory are not on the hard disk but in memory.  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 directory of information about process X, which is the identification number of this process. Each process has a directory called its own process number under/proc.

(2) /proc/cpuinfo    Storage 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    shows the DMA channel currently in use.

(5) /proc/filesystems    The file system information of the core configuration.

(6) /proc/interrupts    Displays the information about the interrupted information and occupants, and the number of occupied.

(7) /proc/ioports    The I/O port currently in use.

(8) /proc/kcore    System physical memory image. It is exactly the same size as the physical memory, but it does not actually occupy so much memory; it is only created 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 core output message. will also be sent to the syslog.

(Ten) /proc/ksyms    core symbol table.

(one) /proc/loadavg    system "average load"; 3 meaningless indicators indicate the current workload of the system.

/proc/meminfo    A variety of memory usage information, including physical memory and swap partition (swap).

/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 is stored to view the/PROC program. When 2 processes view/proc, this will be a different 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 starts.

( /proc/version ) Core version.

10./root Catalogue

The system administrator's home directory. As the owner of the system, there must be some privilege! such as owning a directory alone.

11./sbin Catalogue

S is the meaning of super user, which means that the management program used by the system administrator is stored here. All directory sbin contains root permissions to perform.

12./tmp Directory

Store some temporary file data generated by the program at run time. However, after booting the boot, it is best to use /var/tmp to replace/ TMP, because the former may have a larger disk space.

13./var directory

  /var contains 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. It is also an overflow area for some large files.

(1) /var/catman      the formatted Help (man) page is included. The source file for the help page is generally present in/usr/man/man, 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/catman are often cleared, just as you would clear a temporary directory.) ) 

(2) /var/lib    The file to be changed when the storage system is in normal operation.

(3) /var/local    stored variable data for the programs installed in the/usr/local (that is, programs installed by the system administrator). Note that if necessary, even locally installed programs will use other/var directories, such as/var/lock.

(4) /var/lock    lock 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 will not use this device or document when they notice the lock file .

(5) /var/log    The log files of various programs, especially login (/var/log/wtmp log records to System log and pin) and syslog (/var/ Log/messages Records 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/utmp contains information about the user who is currently logged on.

(7) /var/spool    the directory where the "spool (spool)" program is placed, such as mail, news, print queues, and other queue work. Each of the different spool has its own subdirectory under/var/spool, for example, the user's mailbox is stored in/var/spool/mail.

(8) /var/tmp    than/tmp allows a larger or more temporary file that needs to exist for a longer period of time.  Note system administrators may not allow/var/tmp to have very old files.

14./usr directory

This is the largest directory, and almost all of the applications and files we use are stored in this directory. It contains the following subdirectories;

(1) /USR/X11R6 storage X-window directory;

(2) /usr/bin Centralized almost all user commands, is the system's software library. Some other commands are in /bin or /usr/local/bin .

(3) /usr/sbin includes unnecessary system administration commands for the root file system, such as most service programs.

(4) /usr/man ,/usr/doc ,/usr/info 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 management, and core programs.

(5) /usr/include contains the C language header files needed to develop and compile applications under Linux, which end in. h to describe the data structures, sub-procedures, and constants used in C programs . In order to maintain consistency, this should actually be placed under the/usr/lib, but it is customary to use the name.

(6) /usr/lib name Lib originates from library and stores some common dynamic link shared libraries and static archives. contains the immutable data files for the program or subsystem, including some site-wide configuration files. The original library of programming also exists in/usr/lib. When the program is compiled, the program connects to the library. There are also a number of programs that store configuration files.

(7) /usr/local This is the/USR directory provided to the general user, where the software installation is most suitable;

/usr/local/bin Local Add-on command

/usr/local/lib local additions to the library

(8) /usr/src Linux Open source code exists in this directory.

The role of Linux directories

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.