Monitoring System Resources in Linux: A Comprehensive Bash Script
- Category Shell
- Type Command
- Platform Linux
- Language Bash
- Price Free
- Copy 2 658
- Comments 0
Monitoring System Resources in Linux: A Comprehensive Bash Script
#!/usr/bin/env bash
# Display current CPU, Memory, and Disk usage statistics
# Usage: ./sys-monitor.sh
echo "=== CPU Load ==="
uptime | awk -F'load average:' '{ print $2 }'
echo -e "n=== Memory Usage ==="
free -h | awk 'NR==1 || NR==2'
echo -e "n=== Disk Usage (Top Partitions) ==="
df -h | grep -E '^/dev/' | head -n 5
Free snippet — copy & paste!
Copy this snippet for free on Clayi Code. One click — no account required.
There are no comments yet :(