Linux directory details Linux directory structure detailed analysis _unix Linux

Source: Internet
Author: User
Tags syslog
The root file system should generally be relatively small, since including strict files and a small infrequently changing file system is not susceptible to damage. A corrupted root file system generally means that the risk should not be taken unless the system fails to boot in a specific way, such as from a floppy disk.
The root directory generally does not contain any files, except for the possible standard system-guided mappings, usually called/vmlinuz. All other files are in subdirectories of the root file system.

/bin
The command that is required to boot up or the command that a normal user might use (possibly after boot startup).
/sbin
Similar to/bin, but not for ordinary users, although available if necessary and allowed.
/etc
A configuration file for a particular machine.
/root
The home directory of the root user.
/lib
The shared library required by the program on the root file system.
/lib/modules
Core loadable modules, especially those needed to boot when a damaged system is restored (for example, network and file system drivers).
/dev
Device files.
/tmp
Temporary files. Programs that run after boot startup should use/VAR/TMP instead of/TMP because the former may be on a disk that has more space.
/boot
A file used by the boot loader (bootstrap loader), such as Lilo. Core mappings are also often here, not in the root directory. If there are many core images, this directory can become very large, then it may be better to use a separate file system. Another reason is to make sure that the core image must be within the first 1024 cylinders of the IDE's hard disk.
/mnt
The installation point for the system administrator to mount temporarily. The program does not automatically support installation to/mnt. /mnt can be categorized as subdirectories (for example,/mnt/dosa may be a floppy drive using the Msdos file system, and/mnt/exta may be using the Ext2 file system's floppy drive).
/proc, USR,/var,/home
Installation points for other file systems.

The/etc directory contains many files. Some of these are described below. Other you should know which program they belong to and read the man page of the program. Many network profiles are also in/etc, which are described in the Network Administration Guide.

/ETC/RC or/etc/rc.d OR/ETC/RC? D
To start, or change the directory of the scripts or scripts running at run level, see the chapter on init for more detailed information.

/etc/passwd
User database, where the domain gives the username, real name, home directory, encrypted password, and other information about the user. Format See passwd's man page.

/etc/fdprm
The floppy disk parameter table. Describes the different floppy disk formats. Set with SETFDPRM. See SETFDPRM's man page for more information.

/etc/fstab
A list of file systems that are automatically mount at startup mount-a command (in/ETC/RC or equivalent startup files). Linux also includes information about swap areas that are enabled with SWAPON-A. See section 4.8.5 and the man page of Mount.

/etc/group
Similar to/etc/passwd, but not the user but the group. See Group's man page.

/etc/inittab
The configuration file for init.

/etc/issue
Getty the output information before the logon prompt. Usually includes a short description of the system or a welcome message. The content is determined by the system administrator.

/etc/magic
The configuration file for the file. Contains a description of the different file formats, based on which file types are guessed. See Magic and file's man page.

/etc/motd
Message of the ' Day ' is automatically exported after successful login. The content is determined by the system administrator. Often used to advertise information, such as a warning about scheduled shutdown times.

/etc/mtab
List of currently installed file systems. Initialized by scripts and automatically updated by the Mount command. Used when a list of currently installed file systems is needed, such as the DF command.

/etc/shadow
Shadow password file on a system with shadow password software installed. The shadow password file moves the encrypted password in the/etc/passwd file to the/etc/shadow, which is only readable for root. This makes deciphering the password more difficult.

/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
Files executed by Bourne or C shells at logon or startup. This allows the system administrator to establish a global default environment for all users. The Shell see man page.

/etc/securetty
Confirm the security terminal, which terminal allows root login. Typically, only the virtual Console is listed, which makes it impossible (at least difficult) to break into the system through a modem or network and gain superuser privileges.

/etc/shells
Lists the trusted shells. The CHSH command allows the user to change the login shell within the specified scope of this file. Provides a service process for a machine FTP service FTPD checks whether the user shell is listed in the/etc/shells file, and if not, the user is not allowed to log on.

/etc/termcap
Terminal Performance database. Describes what "escape sequence" controls are used by different terminals. Instead of directly outputting the escape sequence when writing a program (which works only with a specific brand of terminals), you can find the correct sequence of work to do from the/etc/termcap. In this way, most programs can run on most terminals. See the man page of Termcap, Curs_termcap and Terminfo.

/dev Directory
The/dev directory includes device files for all devices. The device file is named with a specific contract, as described in the device list (see [Anv]). The device file is generated during installation and can be described later with/dev/makedev. /dev/makedev.local is a descriptive document written by a system administrator for a local device file (or connection) (that is, some non-standard device drivers are not part of the standard Makedev).

The/usr file system is often large because all programs are installed here. All files in/usr are typically from Linux distribution, locally installed programs and other things under/usr/local. This may not require you to reinstall all programs when upgrading a new system or distribution. Some subdirectories of/usr are listed below (some of the less important directories are omitted, see fsstnd for more information).

/usr/x11r6
All files of the X window System. To simplify X's development and installation, X's files are not integrated into the system. X himself under/usr/x11r6 similar to/usr.
/usr/x386
Similar to/USR/X11R6, but for X11 release 5.
/usr/bin
Almost all user commands. Some commands are in/bin or/usr/local/bin.
/usr/sbin
Root file systems are unnecessary system administration commands, such as most service programs.
/usr/man,/usr/info,/usr/doc
Man pages, GNU information documents, and various other document files.
/usr/include
The header file for the C programming language. For consistency this should actually be under/usr/lib, but it is traditionally supported by this name.
/usr/lib
The unchanging data file of a program or subsystem, including some site-wide configuration files. The name Lib originates from the library. The original inventory of programming is in/usr/lib.
/usr/local
Locally installed software and other files are placed here.
/var/catman
The cache of the man page when the request is formatted. The source files for the man page are generally in/usr/man/man*, and some of the man pages may have preformatted versions that exist 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 others do not have to wait for formatting when they look at the same page. (/var/catman are often cleared, just as you would clear a temporary directory.) )
/var/lib
The file to change when the system is running normally.
/var/local
Variable data for programs installed in/usr/local (that is, programs installed by your system administrator). Note that if necessary, even locally installed programs will use other/var directories, such as/var/lock.
/var/lock
Lock the file. Many programs follow conventions that produce a locked file in/var/lock to support their use of a particular device or file. Other programs notice this locked file and will not attempt to use this device or file.
/var/log
Log files for various programs, especially login (/var/log/wtmp log all to the system logon and logoff) and syslog (/var/log/messages store all core and System program information.) Documents in/var/log often grow in an indefinite manner and should be cleared regularly.
/var/run
An information file about the system that is saved until the next boot. For example,/var/run/utmp contains information about the user who is currently logged on.
/var/spool
Mail, news, print queues, and other queue work directories. 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
A temporary file that is larger than/TMP allowed or that requires a longer period of time. (Although the system administrator may not allow/var/tmp to have very old files.) )

The/proc file system is a fake file system. It does not exist on a disk of disks. Instead, the core is generated in memory. Used to provide information about the system (originally about processes, hence the name). Some of the most important files and directories are described below. The/proc file system is described in more detail in the proc man page.

/proc/1
A directory of information about process 1. Each process has a directory named its process number under/Proc.
/proc/cpuinfo
Processor information, such as type, manufacturer, model, and performance.
/proc/devices
A list of device drivers for the currently running core configuration.
/proc/dma
Displays the DMA channel currently in use.
/proc/filesystems
The file system for the core configuration.
/proc/interrupts
Shows the interrupts used, and how many of the each there have been.
/proc/ioports
The I/O port that is currently in use.
/proc/kcore
System physical memory image. Exactly the same size as physical memory, but does not actually occupy so much memory; it is generated on the fly as programs access it. (Remember: Unless you copy it somewhere, nothing in/proc takes up any disk space.) )
/proc/kmsg
The message for the core output. was also sent to Syslog.
/proc/ksyms
The core symbol table.
/proc/loadavg
System "average load"; 3 meaningless indicators indicate the current workload of the system.
/proc/meminfo
Memory usage information, including physical memory and swap.
/proc/modules
Which core modules are currently loaded.
/proc/net
Network protocol status information.
/proc/self
A symbolic connection to the process directory of the program that is viewing/proc. When 2 processes view/proc, it is a different connection. This mainly facilitates the program to get its own process directory.
/proc/stat
Different states of the system, such as the number of page faults since the ' system was booted.
/proc/uptime
The length of time the system started.
/proc/version
Core version.

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.