Skip to content

top

15 commands

A live, sortable view of processes and system load, CPU and memory.

  • processes
  • performance

Install top

sudo apt install procps

Running7

top

A live view of load, CPU, memory and the busiest processes. Press q to quit.

top -u <user>

Only one user’s processes.

Link
top -p <pid>,<pid>

Watches specific processes.

Link
top -d <seconds>

Changes the refresh interval.

Link
top -o %MEM

Sorts by memory instead of CPU.

top -b -n 1 | head -n 20

Batch mode: one snapshot printed as plain text, suitable for logs and scripts.

top -H -p <pid>

Shows the threads of one process.

Link

Keys inside top6

P / M / T

Sort by CPU, memory or running time.

Link
c

Toggle full command lines.

Link
1

Show each CPU core separately.

Link
k

Send a signal to a process by PID.

Link
V

Tree view of parents and children.

Link
W

Save the current layout to ~/.config/procps/toprc.

Link

Alternatives2

htop

A friendlier interactive viewer with mouse support, tree view and per-core bars.

Link
btop

A modern resource monitor that also shows disk and network graphs.

Link