As sysadmins, we often rely on dashboards like Webmin or cloud monitoring alerts. But when you’re in an exam environment or a recovery shell, those GUIs vanish. You are left with the terminal.
After years of Linux use, I realized that relying on dashboards had dulled my “command line muscle memory.” Here is a consolidated diagnostic cheat sheet that works across the two most common enterprise families: RHEL/Fedora and Debian/Ubuntu.
1. Package Management
This is where you will spend most of your time. RHEL/Fedora uses dnf (the successor to yum), while Debian/Ubuntu uses apt.
| Action | RHEL / Fedora (dnf) | Debian / Ubuntu (apt) |
|---|---|---|
| Update Repos | sudo dnf check-update | sudo apt update |
| Upgrade System | sudo dnf upgrade | sudo apt upgrade |
| Install Package | sudo dnf install <pkg> | sudo apt install <pkg> |
| Remove Package | sudo dnf remove <pkg> | sudo apt remove <pkg> |
| Search Package | dnf search <query> | apt search <query> |
| Clean Cache | sudo dnf clean all | sudo apt clean |
2. Service Management (systemd)
Since 2015, both families have used systemctl. The commands are identical, but the service names often differ (e.g., httpd vs apache2).
| Action | RHEL (e.g., Apache) | Debian (e.g., Apache) |
|---|---|---|
| Start Service | sudo systemctl start httpd | sudo systemctl start apache2 |
| Enable on Boot | sudo systemctl enable httpd | sudo systemctl enable apache2 |
| Check Status | systemctl status httpd | systemctl status apache2 |
| Stop Service | sudo systemctl stop httpd | sudo systemctl stop apache2 |
| Restart Service | sudo systemctl restart httpd | sudo systemctl restart apache2 |
3. System Information & Paths
The logic of where files live is slightly different between the two families.
Network Configuration:
- RHEL/Fedora:
/etc/NetworkManager/system-connections/ - Debian/Ubuntu:
/etc/netplan/or/etc/network/interfaces
Log Files:
- RHEL/Fedora:
/var/log/messages - Debian/Ubuntu:
/var/log/syslog - Universal: Use
journalctl -xefor modern systemd logs.
4. Hardware/Kernel
- Check Kernel:
uname -r - Battery Health:
upower -i /org/freedesktop/UPower/devices/battery_BAT0 - SSD Smart Data:
sudo smartctl -a /dev/nvme0n1
5. Diagnostic Command Comparison
| Action | Command | System | Notes |
|---|---|---|---|
| CPU Monitoring | top | Universal | |
| Memory Info | free -h | Universal | |
| Install Package | dnf install | RHEL/Fedora | Uses .rpm packages. |
| Install Package | apt install | Debian/Ubuntu | Uses .deb packages. |
| Disk Health | nvme smart-log | Universal | Requires nvme-cli installed. |
| Process Detail | ps aux --sort=-%mem | Universal | |
| Storage I/O | iostat -x 1 5 | Requires sysstat package. | |
| Disk Inventory | lsblk -o NAME,MODEL | Universal | |
| NVMe Health | sudo nvme smart-log /dev/nvme0 | Requires nvme-cli package. | |
| Network Status | nmcli device status | ip link | Ubuntu/Debian often use Netplan. nmcli is default on Fedora. |
| Interface IP | nmcli device show | ip addr | |
| Listening Ports | ss -tulpn | Universal |