How to Monitor Ubuntu System Resources in Real-Time?
Monitoring system resource usage in real-time is essential for maintaining the health, performance, and stability of an Ubuntu system. Whether you are troubleshooting a sudden slowdown, tracking down a memory leak, or simply keeping tabs on hardware health, knowing which tools to use can save hours of diagnostic work. This article provides a comprehensive overview of the top command-line and graphical tools available in Ubuntu to monitor CPU, memory, disk activity, and network traffic as it happens.
Built-in Command-Line Tools
Ubuntu comes equipped with powerful, lightweight tools right out of the terminal that require zero installation and provide instant insights.
top: The classic, default system monitor found on almost every Linux distribution. It displays a dynamic, real-time list of running processes, ordered by CPU usage, along with overall memory and processor statistics.- **
vmstatandiostat**: Ideal for low-level system performance.vmstatgives a quick snapshot of virtual memory, processes, and CPU activity, whileiostatdrills down specifically into central processing unit statistics and input/output usage for devices and partitions.
Advanced Terminal Monitors
For a more visually intuitive and interactive experience within the terminal, several enhanced tools can be easily installed via the package manager.
htop: A heavily upgraded version oftop. It features a color-coded, easy-to-read interface, supports mouse clicks, and allows you to kill processes or sort resource usage without memorizing complex keyboard shortcuts.glances: A Python-based monitoring tool that aims to present a maximum amount of information in a single, compact dashboard. It monitors CPU, load average, memory, network interfaces, disk I/O, and file system spaces simultaneously.btop: A modern, highly customizable monitor featuring a beautiful terminal UI with real-time graphs for CPU cores, memory, disks, and network adapters.
Graphical User Interface (GUI) Options
If you prefer a visual, window-based approach over the command line, Ubuntu offers built-in and third-party desktop applications.
- System Monitor: Ubuntu’s default GUI resource tracker, accessible directly from the applications menu. It features clean, real-time graphs tracking CPU history, memory/swap usage, and network activity, alongside a searchable process manager.
- Stacer: An all-in-one system optimizer and monitor. Beyond tracking real-time CPU and memory usage, it provides a clean interface to clean system caches, manage startup applications, and monitor background services.