Created
February 6, 2025 16:29
-
-
Save Usielrivas/6a4e96df238b26c540ec0fd4c588afc0 to your computer and use it in GitHub Desktop.
This is a simple bash script that provides a quick summary of key system information on Linux. It includes details about the operating system, kernel version, CPU (including number of cores), memory usage, disk space, swap, and system uptime.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "==============================" | |
echo " System Information Summary " | |
echo "==============================" | |
echo "OS: $(lsb_release -d | cut -f2)" | |
echo "Kernel: $(uname -r)" | |
echo "CPU: $(lscpu | grep 'Model name' | sed 's/Model name:\s*//')" | |
echo "CPU Cores: $(lscpu | grep '^CPU(s):' | awk '{print $2}')" | |
echo "RAM Total: $(free -h | awk '/^Mem:/ {print $2}')" | |
echo "RAM Free: $(free -h | awk '/^Mem:/ {print $4}')" | |
echo "Disk Total: $(df -h / | awk '/\// {print $2}')" | |
echo "Disk Free: $(df -h / | awk '/\// {print $4}')" | |
echo "Swap Total: $(free -h | awk '/^Swap:/ {print $2}')" | |
echo "Swap Free: $(free -h | awk '/^Swap:/ {print $4}')" | |
echo "Uptime: $(uptime -p)" | |
echo "==============================" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment