Overview

Common commands for monitoring CPU, memory, disk, network, and overall system health on Linux systems.


CPU Monitoring

Interactive Process Viewer

top

Enhanced version:

htop

Displays:

  • CPU usage

  • Memory usage

  • Running processes

  • Load average

Install:

sudo apt install htop

CPU Information

lscpu

Detailed information:

cat /proc/cpuinfo

Memory Monitoring

Quick RAM Usage

free -h

Example:

               total   used   free  shared  buff/cache  available
Mem:           3.8Gi  1.2Gi  0.5Gi    50Mi      2.1Gi      2.3Gi

Pay special attention to:

  • available

  • used


Detailed Memory Information

cat /proc/meminfo

Memory size only:

grep MemTotal /proc/meminfo

Disk Monitoring

Filesystem Usage

df -h

Example:

Filesystem      Size  Used Avail Use%
/dev/sda1        40G   18G   20G  48%

Directory Sizes

Current directory:

du -sh *

Example:

du -sh /var/*

Load Average

System Load

uptime

Example:

09:00:00 up 5 days, load average: 0.25, 0.30, 0.40

Interpretation:

LoadMeaning
< 1Very light
1 - CPU coresNormal
> CPU coresPotential CPU bottleneck

Process Analysis

Top CPU Consumers

ps aux --sort=-%cpu | head

Top Memory Consumers

ps aux --sort=-%mem | head

Disk I/O Monitoring

Real-Time I/O Statistics

iostat -xz 1

Install:

sudo apt install sysstat

Useful for diagnosing:

  • Slow disks

  • High I/O wait

  • SSD bottlenecks


Network Monitoring

Bandwidth Usage

iftop

or

nload

Install:

sudo apt install iftop nload

Overall Health Check

Quick Server Status

uptime
free -h
df -h
ps aux --sort=-%mem | head

One-Liner Health Check

echo "=== LOAD ==="; uptime; \
echo; echo "=== MEM ==="; free -h; \
echo; echo "=== DISK ==="; df -h

vmstat (Highly Recommended)

One of the most valuable Linux performance tools.

vmstat 1

Provides:

  • CPU utilization

  • Memory usage

  • Swap activity

  • Disk I/O

  • Context switches

  • Process scheduling

Many experienced Linux administrators can identify performance bottlenecks using vmstat alone.


Lab Server Quick Check

For routine monitoring of lab.domain.com:

uptime
free -h
df -h
vmstat 1
ps aux --sort=-%mem | head

If all of these look healthy:

  • Load is low

  • No swapping

  • Disk usage < 80%

  • Memory available > 10%

  • No runaway processes

then the server is usually in good condition.