Monitoring system performance is crucial for maintaining efficiency and diagnosing issues. Two powerful Linux tools, htop
and atop
, provide real-time insights into system resource usage. In this guide, we will explore how to use these tools to monitor CPU, memory, disk, and process activity effectively.
Installing htop and atop
To install these tools, use the following commands:

sudo apt install htop atop # For Debian-based systems
sudo yum install htop atop # For RHEL-based systems
Using htop for Process Monitoring
htop
is an interactive process viewer that provides an improved interface over top
.
- Launch
htop
with:
htop
- Use arrow keys to navigate through processes.
- Press
F3
to search for a process.
- Press
F9
to kill a process.
- Press
F6
to sort processes by CPU, memory, or other criteria.
Using atop for System-Wide Monitoring
atop
provides detailed reports on system resource usage over time.
- Start
atop
with:
atop
- Key highlights:
- Press
m
for memory statistics.
- Press
d
for disk usage.
- Press
n
for network activity.
- Press
c
for command-line details of processes.
Recording System Activity with atop
To record system performance for future analysis, use:

sudo atop -w /var/log/atop.log 10
This records system activity every 10 seconds. To review logs later, run:
sudo atop -r /var/log/atop.log
Conclusion
Both htop
and atop
are essential tools for system administrators. While htop
provides an interactive view for real-time monitoring, atop
offers in-depth historical analysis, making troubleshooting easier.
0 Comments