DAY-7 Linux Basics and Common commands (3)

Source: Internet
Author: User

System Monitoring

1, function: In order to ensure the normal operation of the server. General monitoring 3 states: State of CPU, state of hard disk, state of memory

2, command top--detection system resources used by various processes (equivalent to the win task manager)

3. CPU utilization-The actual usage time divided by the average load of the CPU per working time-how many tasks need to be performed divided by the tasks that can be performed

4, the average load system shows 3 time (1 minutes, 5 minutes, 15 minutes), more accurate detection system load status

I. Status and commands of the CPU

df--View the status of the hard disk (all folders are mapped to a range of the hard disk)

df–h--humanized Unit to show

df–i--View File Number

mount--View more detailed drive information, xfs-file type

df–t--Viewing the file system type (win file type Ntfs,linux is XFS file system)

Second, the State of memory and commands

1. free--Monitor the state of the memory available indicates how many caches can be freed plus how many buffer and cache

2. Buffer and cache meaning:

buffer--has not been written to the disk content (cache), CPU speed faster than the hard disk, when writing a byte to read, will let the CPU wait for a period of time, write content when the hard disk is slower, when buffer has a certain number, the CPU reads the content, reduce the delay to improve the efficiency of the CPU, Reduce the speed of writing data from memory to hard disk

cache--has been from the hard disk read out of the data stored, by the hard disk to write to memory, the CPU to tune the data execution, a call to initiate a request to write once, often used to a certain piece of data, frequent initiation, delay and amplification, so some CPU to use the cache, directly to the memory of the adjustment can be, Reduces the speed of hard drives and memory, providing data that the CPU often calls

Memory space is buffer and cache, the function of memory to the outside buffer and cache, with the buffer and cache,

3. Some common commands:

A. Test Memory status Command

B. Free memory

C. View the system version

D. View only system kernel version information

E. View all information

F, test drive Read and write speed

G, free–m in units of M view (not accurate)

III. Process Management (command)

(1) PS aux--viewing process

(2) PS aux |head-3--view top three processes

(3) PS AUC |grep ' process name '--filtering process

(4) kill-9--followed by process ID, forced to terminate the process, in the current directory, you can use pkill-9, followed by the process name

(5) pstree--followed by process name, view number of processes

Iv. Disk Management

Partitioning process

1. Create a new disk from a virtual machine

2, use the command fdisk/etc/sdb, start the partition

3, press "n" key, select the partition type "P" (p is the primary partition, E is the extended partition)

4, enter, show the starting partition, how much, + how many g

5, repeat the previous operation, up to 3 primary partitions, and then select "E", start to expand the partition

6, then select "L", began to partition the extended partition, called logical partition

7, Last Click "W", Save, Partition complete

After partitioning is complete, file System (command) is required for the hard disk: Mkfs.xfs/dev/sdb "XFS" for the Linux file system format

Mount the corresponding partition to the specified directory command: mount/dev/sdb1/part1

Uninstall: Umount/part1 forced uninstall: umount-l/part2

DAY-7 Linux Basics and Common commands (3)

Related Article

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.