Keeping track of your system’s performance is crucial for ensuring smooth operation. In Ubuntu, several command-line tools offer real-time monitoring of processes, CPU usage, memory, and other critical resources. Here’s a guide to the most effective methods for monitoring system processes in real-time.
1. Monitoring with top
The top
command provides a real-time view of your system’s active processes, CPU, and memory usage. It’s a built-in tool in most Linux distributions, including Ubuntu.
How to Use:
- Open your terminal and run:
top
- You’ll see a list of active processes along with real-time CPU and memory usage statistics.
Key Features:
- Press
q
to exit thetop
session. - Press
h
for help on using the tool. - Sort by CPU or memory usage by pressing the corresponding column headers (e.g.,
P
for CPU).
2. Monitoring with htop
htop
is a more user-friendly version of top
. It comes with an intuitive interface, making it easier to interact with processes and resources.
Installation:
To install htop
, run:
sudo apt install htop
How to Use:
- Start
htop
with the following command:
htop
Key Features:
- Navigate through the process list using the arrow keys.
- Press F9 to kill a process.
- Press F10 to exit
htop
.
3. Monitoring with glances
glances
offers a comprehensive overview of system resource usage, covering CPU, memory, disk I/O, network, and more. It’s highly configurable and can be used remotely via a web interface.
Installation:
To install glances
, use:
sudo apt install glances
How to Use:
- Launch
glances
by typing:
glances
Key Features:
- See all key system metrics at a glance.
- Ideal for both local and remote monitoring via the web interface.
4. Monitoring with nmon
nmon
(Nigel’s Monitor) is a powerful and lightweight tool that provides detailed performance metrics in an easy-to-read, color-coded format.
Installation:
To install nmon
, run:
sudo apt install nmon
How to Use:
- Start it by typing:
nmon
Key Features:
- Toggle between CPU, memory, disk, and network metrics.
- The color-coded interface makes it easy to interpret system performance.
5. Monitoring with the ps
Command
For a quick snapshot of all running processes, you can use the ps
command. It displays detailed information like process IDs (PIDs), CPU usage, memory usage, and the command name.
How to Use:
- To list all processes, run:
ps aux
Key Features:
- Displays a static snapshot of system processes, unlike the dynamic view provided by
top
andhtop
.
Conclusion
These tools provide efficient ways to monitor system processes and resources in real-time on Ubuntu. Whether you’re looking for a minimal tool like ps
, an all-in-one solution like glances
, or a color-coded visual like nmon
, you’ll find something that fits your needs.
For more tips on system monitoring and other Linux-related guides, explore codeallow.com.