Linux
linuxlinux-commandsReferenceBeginner
Real-Time Process Activity (top)
Monitor real-time CPU usage, memory utilization, load average, and running processes interactively with top.
Verified: 2026-09-30
Tested on:linux Ubuntu 24.04 / Debian 12
Platforms:
linuxmacos
#linux#top#monitoring#cpu#memory
Command
top
Short Description
top provides an ongoing, dynamic real-time view of system performance, including CPU usage, RAM/swap consumption, load averages, and individual process metrics.
Key Interactive Shortcuts in top
| Key | Action |
|---|---|
M | Sort processes by Memory usage (highest first) |
P | Sort processes by CPU usage (highest first) |
k | Prompt for a PID and signal to kill a process |
1 | Toggle individual CPU core breakdown view |
q | Quit top |
Examples
# Launch top
top
# Run in batch mode for automated scripts (sample 1 iteration)
top -b -n 1 | head -n 20