One of the first commands many system administrators learn is
top, which shows (amongst other things) which processes are using the most CPU.
top has been around for years, but the new(-ish) kid on the block is
top, you may need to install
htop performs similarly to
top, but it has more functionality:
F2configures the display setup
F6allows sorting by different columns
twill display a process tree
straceon the highlighted process
l(lowercase L) will show all open files for the highlighted process (using
Lwill show the library calls for the highlighted process (using
- the display may be scrolled horizontally (arrow keys) and vertically (arrow keys or page up/down)
F1shows more help
Some Practical Uses of
- Highlighting a process and pressing the space bar will select that process and show it in a different colour. Multiple processes may be selected, making it easy to track them in the display.
- F9 will kill all selected processes.
F6and sort by
M_SIZEto see which processes are using the most memory (physical and virtual)
As always, the man page has more detail.
Could this Linux Tip be improved? Let us know in the comments below.