Use the Vmstat command to view system resource conditions
How do I see CPU, Memory usage, network traffic, and disk I/O in command line mode?
Q: How can I view CPU, memory usage, network traffic and disk I/O in command line mode?
A: In the command line mode,
1. Commands to view CPU usage
Refreshes every 5 seconds with data on the right-most CPU occupancy
$ vmstat 5
Top then press Shift+p to sort by process processor occupancy
$ top
2. Commands to view memory usage
View memory usage with the free command
$ free
Top and then press Shift+m to sort by process memory usage
$ top
3. View network traffic
You can use tools Iptraf tools
$ iptraf-g
Network traffic for a interface can be obtained by comparing the RX and TX data of two time network interfaces
$ date; Ifconfig eth1
$ date; Ifconfig eth1
4. View disk I/O
Use Iostat to see disk I/O for disk/DEV/SDC3, refreshed every two seconds
$ iostat-d-X/DEV/SDC3 2
View the IO section information with Vmstat
Linux view CPU, memory, hard disk
1 Viewing CPUs
1.1 Viewing the number of CPUs
# Cat/proc/cpuinfo | grep "Physical ID" | Uniq | Wc-l
Uniq command: Delete duplicate rows; wc–l command: Count rows * *
1.2 Viewing CPU Cores
# Cat/proc/cpuinfo | grep "CPU Cores" | Uniq
CPU Cores:4
1.3 View CPU Models
# Cat/proc/cpuinfo | grep ' model name ' |uniq
Model Name:intel (R) Xeon (r) CPU E5630 @ 2.53GHz
Summary: The server has 2 4-core CPUs, Model Intel (R) Xeon (r) CPU E5630 @ 2.53GHz
2 Viewing memory
2.1 View Total Memory
#cat/proc/meminfo | grep memtotal
memtotal:32941268 KB//Memory 32G
3 Viewing the hard drive
3.1 Viewing hard disk size
# Fdisk-l | grep Disk
disk/dev/cciss/c0d0:146.7 GB, 146778685440 bytes
Summary: Hard disk size 146.7G, that is, the factory trademark 160G
Linux View CPU memory network traffic disk IO