Skip to content

Instantly share code, notes, and snippets.

@yazanmonshed
Created May 18, 2024 08:26
Show Gist options
  • Save yazanmonshed/11d532238b1543d276003590321c9770 to your computer and use it in GitHub Desktop.
Save yazanmonshed/11d532238b1543d276003590321c9770 to your computer and use it in GitHub Desktop.
#!/bin/bash
while true; do
clear
echo "System Resource Monitoring"
echo "--------------------------"
# Display CPU usage
echo "CPU Usage:"
top -n 1 -b | grep "Cpu"
# Display memory usage
echo -e "\nMemory Usage:"
free -h
# Display disk space usage
echo -e "\nDisk Space Usage:"
df -h
sleep 5 # Wait for 5 seconds before the next update
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment