Linux for Developers Course
Linux for Developers
/
Intermediate

htop

Definition

An interactive, visually enhanced process viewer. It is a more modern, user-friendly alternative to `top`, featuring color-coded graphs and the ability to scroll horizontally and vertically.

Explain Like I'm New

Task Manager with a beautiful UI. It draws colorful bars to show CPU usage, lets you use the mouse to click on things, and lets you kill processes without typing their numbers.

Real World Example

Instead of using `ps` to find an ID and then typing `kill`, a developer opens `htop`, uses the arrow keys to highlight the frozen database process, and hits the `F9` key to instantly kill it.

Common Use Cases

  • •Interactive process management
  • •Visual performance monitoring

Interview Questions

basic

  • Is `htop` installed by default on all Linux servers?

intermediate

  • How does `htop` display processes that have multiple threads?

Flash Cards

Question

Installed by default?

Click to reveal answer
Answer

No. It is a third-party package you almost always have to install manually (`sudo apt install htop`).

Question

How are threads displayed?

Click to reveal answer
Answer

By default, `htop` displays them as a nested tree structure, clearly showing which child threads belong to which parent process.