The basic structure of the gradual Linux 1:linux

Source: Internet
Author: User

Before work, comb through Linux, just in time for the book discount, get the "Step by Piece Linux"

first, partition naming :

Linux's hard disk naming scheme is file-based and is generally named as follows:

/dev/hda2/dev/sdb3

/dev: All device files stored in directory

HD and SD: Represents the type of device on which the partition resides. HD stands for IDE hard disk, SD for SCSI hard disk

A: Indicates which device the partition is on, such as/dev/hda represents the 1th IDE hard disk

2: Represent partitions, Linux the first 4 partitions (primary or extended) are represented by the number 1-4, logical partitions start at 5

/dev/hda2 represents the 2nd primary or extended partition of a 1th IDE hard disk

/DEV/SDC6 represents the 2nd logical partition of a 3rd SCSI hard disk

Second, the Linux console

The default Linux has 6 character consoles, independent work, not affect each other

CTRL+ALT+F1~F6 switch, CTRL+ALT+F7 switch from character interface to X-window

Third, system and hardware

1. Linux Hardware resource Management

1.1 List all PCI devices

// More details

1.2 Viewing CPU Information

 More/proc/cpuinfo

Processor: Logical processor Unique identifier

Physical ID: A unique identifier for each physical package, that is, a physical CPU

Siblings: Number of logical processors in the same physical package

Core ID: Unique identifier per core

CPU cores: Number of cores in the same physical package

There is a correspondence between the siblings and the CPU cores values,

If siblings is twice times the CPU cores, the system supports hyper-threading and is turned on

If the siblings is the same as the CPU cores value, the system does not support hyper-threading or does not open Hyper-threading

View the number of physical CPUs, view the number of cores in each physical CPU, and view the number of all logical CPUs in the system (number of physical CPU cores + number of hyper-threads)

//To view the number of physical CPUsCat/proc/cpuinfo |grep "Physical ID"|Sort|Uniq|WC-L//View the number of cores per physical CPUCat/proc/cpuinfo |grep "CPU Cores"//View the number of logical CPUs in the systemCat/proc/cpuinfo |grepProcessor |WC-L

1.3 Viewing system memory information

 More/proc/meminfo

1.4 Viewing disk partition information

Fdisk-l

2. Use of Linux external devices

Device files in the Linux system under/dev, the name is the main device number + secondary device number, the main device number describes the device type, the secondary device number indicates which device

Floppy:/DEV/FD (.)

U disk:/dev/sd (A, b..) The USB drive is recognized as a SCSI device under Linux

Optical drive: IDE optical drive corresponds to/DEV/HD (a, B.), SCSI drive corresponds to/DEV/SR (.)

Tape:/dev/st (...)

File system type

File system format Note
Msdos DOS File system type
Vfat A DOS Partition file system type that supports long file names and can also be understood as a Windows file system type
iso9660 Disc Format File system type
Ext2/ext3/ext4 Linux Common File system types
Xfs Linux under a high-performance log file system, CentOS 7 as the default file system

Mount Device:

Mount -T file system type device name mount point

/mnt directory specifically as a temporary mount point directory

/media directory is a directory that is automatically mounted

Mount -t Msdos/dev/fd0/mnt/floppu    // Mount floppy mount -T Vfat/dev/sda1/mnt/usb       // Mount u disk mount -T Iso9660/dev/hda/mnt/cdrom   // Mounting Discs Mount /dev/cdrom/mnt/cdrom            //  Mount CD

To uninstall a device:

Umount Mount Directory umount /mnt/usb            //  Uninstall USB drive umount /mnt/cdrom          //  unmount disc

III. structure of the file system

1. Directory structure

Linux systems are stored as files in the root directory, and categorized hierarchically organized into a tree directory structure

/etc Directory: Store system Management related configuration files and subdirectories (important to have initialization files/ETC/RC user Information/etc/passwd daemon/etc/crontab DNS profile/etc/resolv.conf)

/usr directory: main storage applications and files

/var directory: The main storage system running and software running log information

/dev Directory: Primary storage System device files

/proc directory: is a virtual directory, all the information in the directory is a memory map, you can obtain process-related information and can also modify the kernel parameters while the system is running,/proc directory exists in memory instead of hard disk

/boot directory: storing Linux boot files

/bin and/sbin: Store executable binaries, which are binary abbreviations.

The/bin directory holds common Linux commands,

s in the/sbin directory refer to Superuser, only Superuser can perform these, common such as disk check repair FCSK, disk partition fdisk, create file system MKFS, shutdown shutdown, initialize system init

/home directory: Working directory for each user

/lib directory: Shared libraries and image files

/root directory: Super User default home directory

/run directory: External device automatic mount point directory,/media and/run basically similar,/mnt is a manual mount point

/lost+found: Used to save lost files, such as improper shutdown and disk errors resulting in loss of files, then placed here, in addition to/root directory, each partition has this directory

/tmp Directory: Temp file directory

Iv. system service Management tools SYSTEMD

1. Start, stop, restart, reload service

Systemctl start Httpd.service            //  start systemctl stop  httpd.service            / / Stop systemctl Restart Httpd.service          // Restart (service is not running, open)systemctl reload Httpd.service             Reload the configuration file

2. Viewing, prohibiting, and enabling services

The Enable and disable service here means boot

Systemctl Enable Http.service         //  enabled service systemctl disable Http.service        // Prohibited Services

The basic structure of the gradual Linux 1: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.