Essential Linux System Monitoring: Master CPU, Memory, and Disk Usage

Memory, CPU, bandwidth, and disk usage are common aspects to monitor in Linux operations. Understanding how to check this information is a necessary skill. Below are several commonly used commands.
General CPU and Memory
top:
Usage command: top
Essential Linux System Monitoring: Master CPU, Memory, and Disk Usage
Top Half
%us
Indicates the CPU usage rate of user space programs (not scheduled by nice)
%sy
Indicates the CPU usage rate in system space, mainly for kernel programs
%ni
Indicates the CPU usage rate of user space programs scheduled by nice
%id
Idle CPU
%wa
CPU time spent waiting for IO
%hi
Number of hard interrupts processed by the CPU
%si
Number of soft interrupts processed by the CPU
%st
CPU stolen by virtual machines
Bottom Half
PID
Process Identifier
USER
Process owner
PR
Process priority
NI
Process priority value
VIRT
Virtual memory value occupied by the process
RES
Physical memory value occupied by the process
SHR
Shared memory value used by the process
S
Process state, where S indicates sleeping, R indicates running, and Z indicates zombie
%CPU
CPU usage rate occupied by the process
%MEM
Percentage of physical memory occupied by the process
TIME+
Total CPU time occupied since the process started
Command
Command name that started the process
Memory
free
Usage command: free
Essential Linux System Monitoring: Master CPU, Memory, and Disk Usage
total
Total physical memory.This value represents the total size of all physical memory (RAM) in the system
used
Used physical memory.This value represents the memory currently used by the operating system and applications, including memory occupied by the program itself and data used for caching and buffering
free
Free physical memory.This is the physical memory that is currently not in use
shared
This field indicates the portion of memory used for inter-process shared memory, usually allocated by <span>tmpfs</span> or similar mechanisms
buff/cache
Memory occupied by buffers and caches.The Linux system tries to utilize free memory to cache data in the file system to speed up file reading. This memory can be quickly released for application use when needed
available
Available memory.This value indicates the memory actually available for new processes in the system, including <span>free</span> memory and memory that can be reclaimed at any time from <span>buff/cache</span> memory
CPU:
cat /proc/meminfo
Usage command: cat /proc/meminfo
Essential Linux System Monitoring: Master CPU, Memory, and Disk Usage
pidstat
Usage command: pidstat
Essential Linux System Monitoring: Master CPU, Memory, and Disk Usage
Parameter
Explanation
%usr
User CPU usage rate
%system
Kernel CPU usage rate
%guest
CPU usage rate for running virtual machines
%wait
Waiting CPU usage rate
%CPU
Total CPU usage rate
Disk:
df
Usage command: df
<span>df</span> command is used to display the disk usage of the file system. The default display unit is KB
Essential Linux System Monitoring: Master CPU, Memory, and Disk Usage
Name
Explanation
Filesystem
Name of the file system
Size
Total capacity of the file system
Used
Used disk space
Avail
Available disk space
Use%
Percentage of used space out of total space
Mounted on
Mount point of the file system (i.e., the directory where the file system is located)
  1. du

  2. Usage command: du

  3. <span><span>du</span></span> command is used to estimate the disk usage of files or folders.

  4. Essential Linux System Monitoring: Master CPU, Memory, and Disk Usage
  5. lsblk

  6. Usage command: lsblk

    1. <span><span>lsblk</span></span> command displays all available disks and partitions in a tree structure, but it does not show the specific usage of the mount points.

  7. Essential Linux System Monitoring: Master CPU, Memory, and Disk Usage
<span><span>Follow me:</span></span>
<span><span>Previous article recommendations:</span></span>
<span>New SSH management choices! Recommended popular management tools</span>
<span>[Linux] Strengthening the Linux operating system: Remote login hardening</span>
<span>[Windows] Strengthening Windows server security</span>
<span>Say goodbye to Ping and Telnet, and delve into the efficient network scanning tool: Nmap introduction</span>
<span>Essential for efficiency! Recommended Windows packet sending tool: SocketTool</span>

Leave a Comment