Linux machine resources viewing and monitoring

The Linux system server is getting more and more popular, requiring us to master some common Linux system monitoring commands to check that the code we developed or written in handling the big files, there is no bottleneck for the machine resources.

First, Linux device management related commands

1. CPU-related, Linux’s CPU configuration In / proc / cpuinfo file, you can use the CAT / proc / cpuinfo command to view, the CPU file is generally large, we can use more command paging display

Cat / proc / cpuinfo | more

Number of CPUs:

CAT / PROC / CPUINFO | GREP “Processor” | WC -L

CPU core:

CAT / Proc / CPUInfo | GREP “CPU Cores” | awk ‘nr == 1 {Print $ 4}’

CPU model:

CAT / PROC / CPUINFO | GREP ‘Model Name’ | Uniq

2, system memory, memory management file is / proc / meminfo file

CAT / proc / memoryfo

Memtotal is the total memory, the size is KB

Memfree is idle memory

3, check the hard drive

CAT / Proc / SCSI / SCSI


4, check the operating system version

CAT / Proc / Version

Second, system resource monitoring common command

1, VMSTATA, VMSTAT command to get information about processes, memory usage, memory idle, page swap space, CPU activities, etc. You can use this command to see if the CPU is enough, whether the memory is enough, etc.

EG, VMSAT 2 shows a machine resource usage every 2 seconds

VMSTAT common parameters

-n: Only display a field name only at the beginning

-a: Show active and non-active memory

-d: Displays the relevant statistics of each disk

-D: Display Disk Overall Information

-p: Display specified disk partition statistics

-s: Show memory related statistics and number of system activities


-t: When the output is output, it will output it.

-S: Use the specified unit to display. There are K, K, M, M, represent 1000, 1024, 1000000, 1048576 bytes, respectively. The default unit is k

-v display version

2, TOP command

The TOP command is often used to monitor Linux system conditions, such as CPU, memory usage, etc.

Related Posts