KevsRobots Learning Platform
40% Percent Complete
By Kevin McAleer, 2 Minutes
Monitoring system performance is crucial for keeping your Raspberry Pi running smoothly. This lesson will introduce you to commands that help you keep track of disk usage, CPU load, and memory usage.
df
and du
.top
and htop
.free
.df
(disk free): Displays the amount of disk space used and available on all mounted filesystems.
df -h
Note -h
: Displays output in human-readable format (e.g., KB, MB, GB).
du
(disk usage): Estimates file space usage. Use it to check how much space a directory is using.
du -sh /home/pi
Note -s
: Displays only a total for each argument. -h
: Displays output in human-readable format.
top
and htop
top
: Displays real-time information about running processes, including CPU and memory usage.
top
htop
: A more user-friendly version of top with an easier-to-read interface. You may need to install it first:
sudo apt install htop
htop
free
The free command displays the total, used, and available memory on your Raspberry Pi. For human-readable output, use:
free -h
In this lesson, you learned how to monitor system performance using commands like df
, du
, top
, and free
. Regular monitoring can help you detect and troubleshoot potential issues before they become serious problems.
You can use the arrows ← →
on your keyboard to navigate between lessons.