Live monitoring in Linux: top and htop
Updated July 3, 2026
top and htop show a live list of processes, sorted by their CPU or memory load.
Common cases
top # a live list, q to quit
htop # friendlier: colour, scrolling, mouse
# inside top:
# P sort by CPU
# M sort by memory
# k send a signal to a process
ps aux --sort=-%cpu # a snapshot: top by CPU, no live modeHow it works: a snapshot versus live mode
psgives one snapshot and exits, whiletopandhtoprefresh every couple of seconds. That is what you need to catch what is loading the system. The top rows show a summary: the load average, CPU usage and memory. Below them are the processes, the greediest on top by default.htopis nicer thantop: you can scroll the list, click a process and kill it, and per-core usage bars sit at the top. Ifhtopis not installed,topis always there.
In the book
This topic is covered in full in the chapter Monitoring and bottlenecks.
See also
Viewing processes, Memory: free, Load average, The vmstat command.
Try it
Open the sandbox: a real throwaway Linux terminal in your browser. Run the commands above by hand - the container is deleted when you leave.