What is top
top is the standard Linux tool for monitoring running processes in real time. It updates every few seconds and shows CPU usage, memory usage, load average, and a ranked list of processes. It is available on every Linux system without installing anything.
Start top
top
Press q to quit.
Reading the header
The first lines show system-wide statistics:
top - 10:32:01 up 5 days, 3:14, 2 users, load average: 0.42, 0.38, 0.35
Tasks: 142 total, 1 running, 141 sleeping, 0 stopped, 0 zombie
%Cpu(s): 3.2 us, 1.1 sy, 0.0 ni, 95.4 id, 0.2 wa, 0.0 hi, 0.1 si
MiB Mem : 7871.8 total, 3201.4 free, 2104.2 used, 2566.2 buff/cache
MiB Swap: 2048.0 total, 2048.0 free, 0.0 used. 5431.1 avail Mem
Key values:
- load average — system load over the last 1, 5, and 15 minutes. Values above the number of CPU cores indicate saturation.
- %Cpu —
us(user),sy(kernel),id(idle),wa(waiting for I/O) - buff/cache — memory used for disk cache; Linux reclaims it when processes need more RAM
Process table columns
| Column | Meaning |
|---|---|
PID |
Process ID |
USER |
Owner |
PR |
Priority |
NI |
Nice value (negative = higher priority) |
VIRT |
Total virtual memory |
RES |
Resident (physical) memory in use |
%CPU |
CPU share since last update |
%MEM |
Physical memory share |
TIME+ |
Total CPU time used |
COMMAND |
Process name |
Interactive commands
While top is running you can press keys to change behavior:
| Key | Action |
|---|---|
q |
Quit |
M |
Sort by memory usage |
P |
Sort by CPU usage (default) |
T |
Sort by time |
u |
Filter by user (enter username) |
k |
Kill a process (enter PID) |
r |
Renice a process (change priority) |
1 |
Toggle per-CPU stats |
d |
Change update interval |
Space |
Refresh immediately |
h |
Help |
Useful options
top -u username show only processes owned by a user
top -p 1234,5678 monitor specific PIDs
top -d 5 set update interval to 5 seconds
top -n 3 run 3 iterations and exit (useful in scripts)
top -b -n 1 batch mode, one snapshot (pipe-friendly)
Capture a process snapshot to a file:
top -b -n 1 > top-snapshot.txt
Find what is eating CPU or RAM
Sort by CPU: press P (default on startup).
Sort by memory: press M.
To check a specific process:
top -p $(pgrep nginx)
See also
If top feels dated, try htop — it has color, mouse support, and easier sorting. Install it with apt install htop or dnf install htop.
man top for the full reference.
- Created: June 25, 2007
- Last edited: July 7, 2026