System Monitoring
top
- Real-time process and resource usage
- Press ‘q’ to quit, ‘1’ for per-CPU view
htop
- Enhanced interactive process viewer
- Color-coded, sortable columns
iostat -x 1
- Disk I/O statistics every second
- Shows utilization, wait times
vmstat 1
- Virtual memory and system stats
- CPU, memory, I/O summary
Memory Analysis
free -h
- Memory usage in human-readable format
- Shows available, used, cached
cat /proc/meminfo
- Detailed memory information
- All memory statistics available
Disk Performance
iotop
- Shows I/O usage by process
- Real-time disk read/write activity
df -h
- Filesystem disk space usage
- Human-readable sizes
du -sh /path/*
- Directory size summary
- Shows space used by folders
Network Performance
iftop
- Network bandwidth by connection
- Real-time traffic monitoring
nethogs
- Network usage by process
- Shows which apps use bandwidth
ss -tuln
- Socket statistics
- TCP/UDP listening ports
Process Analysis
ps aux --sort=-%cpu
- Processes sorted by CPU usage
- Shows all running processes
pgrep -f process_name
- Find process IDs by name
- Useful for scripting
Example Monitoring
|
|