top command
Watch processes and CPU and memory use live.
- Processes & services
- Package procps
- 5 options · 5 examples
Syntax
top [options]Provided by the procps package. Run man top for the full manual.
Common options
| Option | What it does |
|---|---|
-u USER | Only that user's processes |
-p PID | Only these process IDs |
-d N | Refresh every N seconds |
-b | Batch mode for scripts |
-n N | Stop after N refreshes |
Examples
Start top
topOnly one user's processes
top -u www-dataWatch one process
top -p 1234One snapshot for a script
top -b -n 1 | head -20Refresh every 5 seconds
top -d 5
No example matches. Check the options table or search the guides.
Tips
- Inside top:
Psorts by CPU,Mby memory,kkills a process,1shows each CPU,qquits.
top guides
- Understanding the Top Command Output in Linux Linux Commands · Updated Apr 2025
- Top Command in Linux (System & Process Monitoring) Linux Commands · Updated Apr 2025
