How to Monitor System Resources in Ubuntu Linux

Whether you are running a high-traffic web server or simply using a desktop machine for daily tasks, keeping an eye on your computer’s performance is crucial. If your system begins to slow down, freeze, or act unresponsively, the first step in troubleshooting is to monitor system resources in Ubuntu Linux. By checking your CPU usage, RAM allocation, and disk space, you can quickly identify which applications are causing the bottleneck.

In this guide, we will cover the best command-line tools and graphical applications to help you keep your Ubuntu system running smoothly.

Using the Command Line: Top and Htop

For many Linux users, the terminal is the fastest and most efficient way to interact with the operating system. There are two primary commands you should learn for resource monitoring.

The “top” Command

The top command comes pre-installed on virtually every Linux distribution. It provides a real-time, dynamic view of the running processes in your system.

  • Simply open your terminal (press Ctrl + Alt + T).
  • Type top and press Enter.
  • You will see a constantly updating list of processes, sorted by CPU usage. The header provides an overview of your total memory, swap usage, and system uptime.
  • Press q to exit the interface.

The “htop” Command

While top is highly functional, htop provides a much more user-friendly, colour-coded interface that allows you to scroll horizontally and vertically. It also includes visual meters for your CPU cores and RAM.

  • To install it, run: sudo apt install htop
  • Once installed, type htop to launch it.
  • You can use your mouse or arrow keys to select specific processes and press F9 to easily kill a frozen application.

Using the Graphical System Monitor

If you prefer a visual interface and are using the default GNOME desktop environment on Ubuntu, you do not need to use the terminal at all. Ubuntu includes a powerful graphical tool that functions similarly to the Windows Task Manager.

  1. Press the Super (Windows) key to open the Activities overview.
  2. Type System Monitor into the search bar and press Enter.
  3. The application will open, displaying three main tabs:
    • Processes: A list of all running applications. You can right-click any process to stop or kill it.
    • Resources: Beautiful, real-time line graphs showing your CPU history, memory and swap history, and network bandwidth usage.
    • File Systems: A detailed breakdown of your hard drives, showing how much disk space is used and how much is available.

Checking Disk Space with “df”

If you only need to quickly check how much storage space you have left without launching a full monitoring tool, the df (disk free) command is incredibly useful.

  • Open the terminal and type df -h.
  • The -h flag stands for “human-readable”, meaning the output will be displayed in Megabytes (MB) and Gigabytes (GB) rather than raw blocks.

Frequently Asked Questions

What does “Swap” memory mean?

Swap space is a designated portion of your hard drive that Ubuntu uses as “virtual RAM” when your physical RAM is completely full. High swap usage often indicates that you need to upgrade your physical memory.

Is it safe to kill any process in htop?

You should only kill processes that you recognise, such as a frozen web browser or a specific application you launched. Killing critical system processes can cause your computer to crash or restart.

By familiarising yourself with these monitoring tools, you can easily diagnose performance issues and ensure your Ubuntu system remains stable and efficient.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.