~2 min read • Updated Jul 21, 2025

1. What Is top?


top is a terminal-based program that displays dynamic, real-time information about system activity. It helps system administrators identify high-resource processes and monitor overall system health.


2. Running top


Usually preinstalled in most Linux distributions, you can launch it with:

top

3. Basic top Output


  • uptime: Duration the system has been running
  • load average: System load over the past 1, 5, and 15 minutes
  • Tasks: Total number of processes (running, sleeping, stopped)
  • CPU usage: Percent CPU used by user/system/idle
  • Memory: RAM usage breakdown
  • Swap: Swap memory usage

4. Interactive Control Keys


KeyFunction
hDisplay help screen
kKill a process (enter PID)
rRenice a process
uFilter by user
n / #Set number of processes to show
qQuit top

5. Useful Command-Line Options


  • -d: Refresh interval in seconds
  • top -d 3
  • -u: Show processes by specific user
  • top -u jina
  • -p: Show specific process IDs
  • top -p 1234,5678

6. Sorting Within top


  • P – Sort by CPU usage
  • M – Sort by memory usage
  • T – Sort by time running

7. Enhanced Alternative: htop


htop offers a more user-friendly and graphical interface:

sudo apt install htop
htop

8. Practical Use Cases


  • Identify CPU-intensive processes
  • Monitor RAM usage trends
  • Kill or renice unresponsive processes
  • Investigate system slowdowns

9. Conclusion


top is a foundational Linux tool for understanding what’s consuming system resources in real time. With its keyboard shortcuts and configurable options, it empowers administrators to detect performance bottlenecks and manage processes effectively.


Written & researched by Dr. Shahin Siami