Skip to content

Instantly share code, notes, and snippets.

@p404
Last active April 11, 2017 14:13
Show Gist options
  • Save p404/1d23e0f77af0334eb2be to your computer and use it in GitHub Desktop.
Save p404/1d23e0f77af0334eb2be to your computer and use it in GitHub Desktop.
Hardware Info Linux script
#/bin/bash
echo "Hardware Info"
# CPU
echo "CPU $(cat /proc/cpuinfo | grep 'model name' | uniq)"
echo "Cores : $(cat /proc/cpuinfo | grep processor | wc -l)"
echo "Physical cores: $(cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l)"
# RAM
echo "RAM : $(dmidecode -t 17 | grep "Size.*MB" | awk '{s+=$2} END {print s / 1024}')G"
# Disk space
echo "Total Disk Space : $(df -h --total | grep 'total' | awk '{print $2}')"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment