Last active
May 23, 2022 13:59
-
-
Save Ran-Xing/8eb22c8c93ff6be334ddc87fcda198e5 to your computer and use it in GitHub Desktop.
Linux hardware details
This file contains hidden or 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
#!/usr/bin/env bash | |
clear | |
printf "\n%s\n\n" "-----------------------" | |
echo "CPU: $(grep -c processor /proc/cpuinfo) 核心" | |
echo "内存: $(($(free | grep Mem | cut -d " " -f 9) / 1024 / 1024)) G" | |
echo "网络: $(curl -s cip.cc | grep "数据二" | cut -d " " -f 2)" | |
echo "磁盘: $(lsblk -f | grep ext4 | cut -d " " -f 14 | tr -s "\n" " ")" | |
printf "\n%s\n\n" "-----------------------" |
ubuntu-server
echo "内存: $(($(free | grep Mem | cut -d " " -f 8) / 1024 / 1024)) G"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -sLm 10 https://ghproxy.com/https://gist.githubusercontent.com/Ran-Xing/8eb22c8c93ff6be334ddc87fcda198e5/raw/27a563d9a0562292c2287cf19daaf192f7c521c3/hardware.sh | bash