Linux for Developers Course
Linux for Developers
/
Beginner

top

Definition

A command-line utility that displays a dynamic, real-time, continually updating view of running processes and system resource usage (CPU, RAM).

Explain Like I'm New

The live Windows Task Manager for Linux. The screen constantly refreshes every 3 seconds to show you exactly which app is eating all your CPU.

Real World Example

Your web server is incredibly slow. You type `top`. The list constantly updates, and you see that a rogue Python script is stuck in an infinite loop, consuming 99.9% of the CPU.

Common Use Cases

  • •Performance monitoring
  • •Identifying resource hogs

Crucial Command Flags

Flag / OptionDescription
-d [sec]Delay. Update the screen every [sec] seconds.
-u [user]Monitor only processes owned by a specific user.
-iIdle. Ignore idle or zombie processes.

Interview Questions

basic

  • How do you exit the `top` interface?

intermediate

  • In `top`, what is 'Load Average' (e.g., 1.50, 0.80, 0.75)?

Flash Cards

Question

How to exit?

Click to reveal answer
Answer

Press the `q` key.

Question

What is Load Average?

Click to reveal answer
Answer

It shows the system load over the last 1, 5, and 15 minutes. A load of 1.0 on a single-core CPU means the CPU is exactly 100% utilized. A load of 2.0 means it is overwhelmed and tasks are waiting in line.