Skip to main content

Linux Monitoring Tools

top: Basic Linux System Monitor

In this article, learn how to use the Linux top command to monitor CPU, memory, and processes, with tips for sorting and managing tasks.

The top command (short for table of processes) displays the processor activity of your currently running processes, which includes CPU and memory usage, system load averages, along with other important system metrics that help you monitor the health of your Linux server.

For beginners, top is one of the first commands you should learn because it gives you immediate insight into what is happening inside your system.

Launching top and Understanding the Output

To start using top, simply open your terminal and type:

top

Once you press Enter, top will display a live, updating interface showing the current state of your system, which is divided into two main sections, each providing important information about system performance and running processes:

1. System Summary (Top Section)

The summary area shows overall system metrics, which are updated every few seconds and include some key metrics:

  • Uptime and load averages: Shows how busy your system has been over the last 1, 5, and 15 minutes.
  • Task count: Number of total, running, sleeping, stopped, and zombie processes.
  • CPU usage: Displays how much CPU is used by user processes (us), system processes (sy), and idle time (id).
  • Memory usage: Shows total memory, free memory, used memory, and cached memory. Swap usage is also displayed.
Top System Summary

2. Process List (Bottom Section)

The process list displays all running processes, sorted by CPU and Memory usage by default, which includes a few important columns.

Column Description
PID Process ID
USER Owner of the process
PR/NI Priority and nice value
%CPU CPU usage percentage
%MEM Memory usage percentage
TIME+ Total CPU time consumed by the process
COMMAND Name of the process/command
Top Process List

Basic Usage of top Command

The top command is interactive, which means you can control what you see in real-time.

Here are some essential commands every beginner should know: