Linux directory structure Introduction and important directory description

Source: Internet
Author: User
Tags system log

Root node:/, all files are mounted under this, directory structure and partition devices are not related, different directories can span different disk devices and partitions


1. View partitions:

[Email protected] downloads]# ls/dev/sda*

/dev/sda/dev/sda1/dev/sda2/dev/sda3


2. Mount: Mount

such as: MOUNT/DEV/SDB1/USR


3. File directory rules:

Application:/usr/bin

Data files, Help:/usr/share

Configuration file:/etc/

Start command:/ETC/INIT.D


4. Path

According to Path: Cd/home

Relative path: CD data/


5. Tree command:

Install: "Yum-y install tree" command operation in CentOS, installation may error

Download: ftp://mama.indstate.edu/linux/tree/Download the installation package

Decompression: TAR-XZVF tree-1.7.0.tgz

Compile: Go to tree-1.7.0 directory, perform make compilation

Copy: CP Tree/bin

Example: Tree-l 1/--all directories in the display/directory, showing only level 1 (L means display level, followed by numbers)


6, the first-level directory structure:

[Email protected] downloads]# tree-l 1/

/--Storage System related procedures

├──bin--the directory in which common binary commands are stored for ordinary users

├──boot --storage of Linux kernel and boot program

├──dev--storage equipment files, such as: disk, sound card, optical drive, etc. view disk: ls/dev/sd*

├──etc--Store binary installation package (yum, rpm), Service Start command, configuration file

├──home--Store user home directory (except root), create a user who will have a folder with the same name here

├──lib--Repository file directory, 32-bit

├──LIB64--Repository file directory, 64-bit system only

├──lost+found-The system crashes or shuts down unexpectedly, the temporary files will be put here, and the next boot will be repaired with fsck

├──media

├──MNT--Temporary mount point, the entry of file system (device), such as: U disk, CD-ROM, etc.

Example:

To view the disk mount condition: fdisk-l

Mount Disk: mount/dev/sdb/mnt, uninstall: umount/mnt

To view mount results: df-h

├──opt-optional, some companies designate this directory as the installation software directory

├──proc-A virtual file system that stores kernel and system information (e.g., disk, memory, CPU)

Example:

View cput Information: Cat/proc/cpuinfo

View memory Information: Cat/proc/meminfo

View payload Information: Cat/proc/loadavg

├──root--root directory of system administrator root

├──sbin--the command to store Superuser root, System Admin user (normal user cannot use)

├──selinux

├──srv

├──sys

├──tmp--Temporary file directory, all users can use

├──USR--Store user programs (many directories are the same as under the root),/usr/local--store user-installed programs

└──var-A directory that stores variable data, such as: logs, caches, logs and fault messages for the recording system

Example:

System log:/var/log/message, storage System log, including failure, etc.

System security log:/var/log/secure, system security information, such as user login information, etc.

Timed tasks:/var/spool/cron


7. Important Sub-directories:

Network card: Cat/etc/sysconfig/network-scripts/ifcfg-eth0,eth0 represents the first NIC

Restart:/etc/init.d/network Restart, for all NICs

Off/On: Ifdown eth0, Ifup eth0, for a network card

Client DNS configuration: cat/etc/resolv.conf

LAN domain name configuration: cat/etc/hosts

Boot from startup program command: Cat/etc/rc.local, similar to Chkconfig function

directory where system services are located: CAT/ETC/INIT.D, a script that hosts systems or services that are started in System V mode

Global environment variable: cat/etc/profile


Linux directory structure Introduction and important directory 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.