top

Real-time dynamic view of system processes, CPU, and memory usage.

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

top provides a live display sorted by CPU usage. Press M to sort by memory, k to kill a process, q to quit. -b runs batch mode for scripting.

Common flags
FlagMeaning
-b --batchNon-interactive batch mode for scripts
-nNumber of iterations before exiting
-pMonitor specific PIDs only
-uShow processes for a specific user
Examples
top -bn1 | head -20Capture a single top snapshot for logging · explain & risk-check →
top -u www-dataMonitor only web server user processes · explain & risk-check →
Pro tip

Install `htop` — same as top but with color, mouse support, and a much cleaner UI: `sudo apt install htop`

Related
htop ps vmstat iostat glances
Open the full explainer →More in System & Processes

Reference text is hand-written and may be incomplete — check man top for your version. Test destructive commands on a non-production system first.