Master Linux System Monitoring: Essential Commands for Kernel, Memory, CPU, and More
This guide walks you through Linux commands to quickly view the kernel version, system details, disk usage, memory statistics, CPU core count, system load, running processes, and port occupancy, providing clear explanations and useful options for each command.
01 View System Kernel Version
Displays the system name (CentOS) and kernel version (release 6.5). The file /etc/issue contains a message or system identification printed before the login prompt.
02 View System Information
Use uname -a to display the system name, node name, OS release number, OS version, and machine ID.
03 View Disk Space Usage
Run df -h -a to list all file systems with human‑readable sizes. Options: -h: human‑readable output -a: include all file systems
04 View Memory Usage
The free command shows total, used, and free memory, as well as buffers and cache. Important lines:
Total memory (e.g., 3072 M) – use free -h for clearer units.
Used memory, free memory, shared memory (usually 0), buffer cache, and page cache.
Relation: total = used + free.
The -/+ buffers/cache line indicates memory actually used by applications versus reclaimable memory.
05 View CPU Core Count
Check the number of CPU cores with commands such as lscpu or by counting entries in /proc/cpuinfo.
06 View System Load
Use uptime to see current time, uptime duration, number of logged‑in users, and average load over 1, 5, and 15 minutes.
The average load is the average number of processes in the run queue during the specified interval. A load per CPU core below 3 generally indicates good performance; values approaching the number of cores multiplied by 3 suggest increasing strain.
07 View Running Processes
List processes with ps aux. To terminate all processes containing the word "worker", use pkill -f worker.
08 View Port Occupancy
Inspect network ports with netstat and various options: -a: show all sockets (default hides LISTEN) -t: display TCP sockets only -u: display UDP sockets only -n: show numeric addresses instead of names -l: list only listening sockets -p: show the program name/PID owning the socket -r: display routing table -e: show extended information (e.g., UID) -s: provide protocol statistics -c: repeat the command at fixed intervals
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
