Skip to content

Instantly share code, notes, and snippets.

@ihashacks
Created October 3, 2016 18:28
Show Gist options
  • Save ihashacks/484c504c58f4464bae7996d305fcd70f to your computer and use it in GitHub Desktop.
Save ihashacks/484c504c58f4464bae7996d305fcd70f to your computer and use it in GitHub Desktop.
quick and dirty Mac sysinfo script
#!/bin/bash
MAC_TYPE=$(curl -s "http://support-sp.apple.com/sp/product?cc=$(system_profiler SPHardwareDataType | awk ' /Serial/ { print $4 } ' | cut -c 9-)" | sed 's|.*<configCode>\(.*\)</configCode>.*|\1|')
MAC_PROCESSOR=$(sysctl -n machdep.cpu.brand_string)
MAC_MEMORY="$(( $(sysctl -n hw.memsize) / 1024 ** 3 )) GB"
MAC_SERIAL=$(system_profiler SPHardwareDataType | awk ' /Serial/ { print $4 } ')
echo "System: ${MAC_TYPE}"
echo "CPU: ${MAC_PROCESSOR}"
echo "Memory: ${MAC_MEMORY}"
echo "Serial: ${MAC_SERIAL}"
@brandonpierce
Copy link

curl -s "https://gist.githubusercontent.com/ihashacks/484c504c58f4464bae7996d305fcd70f/raw/b6987d2d8f9b359e86e50151b079364a39bea0ba/mac_sysinfo.sh" | bash - | pbcopy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment