02_linux directory Structure _ my Linux Road

Source: Internet
Author: User

The first two sections have taught you how to install a Linux system on a virtual machine

In this section, we will learn about the directory structure of Linux, describe the entire system architecture of Linux, and familiarize yourself with Linux

There is a very important concept in Linux or UNIX systems, which isAll Documents

First, let's familiarize ourselves with what all the colors in Linux represent.

Blue represents the directory

For example, directories under the root directory

The cyan color represents a linked file, and may also be used as a shortcut to the Windows side

Green stands for executable files.

Yellow represents the device file.

While plain white (in the case of black background) colors represent ordinary documents, very common

Linux directory structure

Take a look at a picture, as an overview of the directory structure of the branch map (image from the network)

The total directory structure in the real world, such as

The first thing to say is the root directory "/" , Linux is not like windowns, a hard disk is divided into several disks

All files in Linux are stored in the root directory, and the absolute path of each file or directory is started from the root directory.

Then only the root user has write access to the directory

1./bin Directory user binaries

Contains a binary executable file.
In single-user mode, the common Linux commands you need to use are located in this directory. The commands used by all users of the system are set here.
For example: PS, ls, ping, grep, CP (here we are familiar with a concept, in the command line or terminal, want to use the operating system must pass a command)

2./sbin Directory System binaries

Like the bin directory, the Sbin directory is also a binary file

However, the commands in this directory are generally intended for use by system administrators, such as Iptables, reboot, Fdisk, ifconfig, swapon commands

3./ETC Directory Storage configuration file

Contains the configuration files that are required for all programs.
It also contains startup and shutdown shell scripts for starting/stopping a single program. Also contains the Hosts file, the hosts is the domain name resolution to the IP configuration file

4./dev Directory device files

Before with the emphasis on the Linux side of all files, this directory is the file containing the device

These include terminal equipment, USB or any device connected to the system. For example:/dev/tty1,/dev/usbmon0

5./proc directory, storing information about the process

Contains information about the system process.
This is a virtual file system that contains information about the processes that are running. For example: The/proc/{pid} directory contains information related to a specific PID.
system resources exist as textual information. Example:/proc/uptime

6./var directory variable file

var represents a variable file.
This directory allows you to find files that may grow in content.
This includes-system log files (/var/log), Package and database files (/var/lib), e-mail (/var/mail), print queue (/var/spool), lock Files (/var/lock), multiple restarts of required temporary files (/var/tmp) ;

7./tmp directory holds temporary files

Contains system and user-created temporary files.
When the system restarts, the files in this directory will be deleted.

8. The directory of the/USR directory user program

Source code that contains binaries, library files, documents, and level two programs.
The/usr/bin contains a binary file of the user program. If you can't find the user binaries in/bin, go to the/usr/bin directory to see. For example: At, awk, CC, less, SCP.
The/usr/sbin contains the system administrator's binaries. If you can't find the system binaries in/sbin, go to the/usr/sbin directory to see it. For example: ATD, Cron, sshd, Useradd, Userdel.
The/usr/lib contains the libraries used by/usr/bin and/usr/sbin.

For example, my anaconda is installed in USR.

9./home Directory Home Directory

All user's personal files are stored in this file directory, except the root user

For example Susmote user/home/susmote/

./boot directory linux system boot file

Start Linux core files;

Contains the boot loader-related files.
The kernel's initrd, vmlinux, and grub files are located under/boot.

/lib Directory System library files

Contains library files that support binary files located under/bin and/sbin.
The library file is named ld* or lib*.so.*

/OPT Directory optional Application installation folder

OPT stands for optional.
Contains additional applications from individual vendors.
Additional applications should be installed in subdirectories of/opt/or/opt/.

It's usually empty at the beginning.

13. /mnt Directory mount device files

A temporary installation directory where the system administrator can mount the file system.

For example, optical devices

/media directory removable media device files

A temporary directory that is used to mount removable devices.
For example, mount the CD-ROM/media/cdrom, mount the floppy disk drive/media/floppy;

/lost+found Directory Repair Directory

This directory is a directory created using the standard EXT2/EXT3 file system format, which is intended to place missing fragments in this directory when an error occurs in the file system. This directory usually exists at the top level of the splitter slot, for example if you add a hard disk to/disk, and the system will automatically generate a directory like "/disk/lost+found"

/SRV Directory Service data

The SRV Representative service.
Contains data related to server-specific services.
For example,/srv/cvs contains CVS-related data.

02_linux directory Structure _ my Linux Road

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.