System monitoring (htop, ss, ncdu)
Essential commands for monitoring resources and diagnosing problems.
What this tutorial does
The tutorial "System monitoring (htop, ss, ncdu)" helps you achieve this goal:
Essential commands for monitoring resources and diagnosing problems.
Debian/Ubuntu
-
Install the tools: apt install -y htop net-tools iotop ncdu iftop - --- CPU/RAM ---
- Interactive monitoring: htop
- System load: uptime
- Available memory: free -h
- --- Disk ---
- Disk space per partition: df -h
- Analyze space by folder (interactive): ncdu /
- Real-time disk I/O: iotop
- --- Network ---
- Open ports and active connections: ss -tulnp
- Real-time bandwidth: iftop
- --- Process ---
-
Find a process: ps aux | grep nom_processus - Kill a process by PID: kill -9 PID
- --- System logs ---
- Track logs in real time: journalctl -f
- Apache logs: tail -f /var/log/apache2/error.log
- Nginx logs: tail -f /var/log/nginx/error.log