doracoin revised this gist . Go to revision
1 file changed, 2 insertions
sysinfo.sh
| @@ -1,6 +1,8 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | ||
| 3 | 3 | # wget -O sis.sh https://gist.doracoin.cc/doracoin/e29dff46e05840d4878a368399ec1858/download/HEAD/sysinfo.sh | |
| 4 | + | # chmod +x sis.sh | |
| 5 | + | # ./sis.sh | |
| 4 | 6 | ||
| 5 | 7 | echo "=== 系统信息 ===" | |
| 6 | 8 | echo "主机名: $(hostname)" | |
doracoin revised this gist . Go to revision
1 file changed, 2 insertions, 1 deletion
sysinfo.sh
| @@ -1,5 +1,7 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | ||
| 3 | + | # wget -O sis.sh https://gist.doracoin.cc/doracoin/e29dff46e05840d4878a368399ec1858/download/HEAD/sysinfo.sh | |
| 4 | + | ||
| 3 | 5 | echo "=== 系统信息 ===" | |
| 4 | 6 | echo "主机名: $(hostname)" | |
| 5 | 7 | echo "系统版本: $(cat /etc/os-release | grep PRETTY_NAME | cut -d'"' -f2)" | |
| @@ -19,4 +21,3 @@ df -h | grep -E "(^Filesystem|^/dev/)" | |||
| 19 | 21 | ||
| 20 | 22 | echo -e "\n=== 当前负载 ===" | |
| 21 | 23 | w | head -1 | |
| 22 | - | ||
doracoin revised this gist . Go to revision
1 file changed, 22 insertions
sysinfo.sh(file created)
| @@ -0,0 +1,22 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | ||
| 3 | + | echo "=== 系统信息 ===" | |
| 4 | + | echo "主机名: $(hostname)" | |
| 5 | + | echo "系统版本: $(cat /etc/os-release | grep PRETTY_NAME | cut -d'"' -f2)" | |
| 6 | + | echo "内核版本: $(uname -r)" | |
| 7 | + | echo "运行时间: $(uptime -p)" | |
| 8 | + | ||
| 9 | + | echo -e "\n=== CPU信息 ===" | |
| 10 | + | echo "CPU型号: $(lscpu | grep "Model name" | cut -d':' -f2 | xargs)" | |
| 11 | + | echo "物理CPU数: $(lscpu | grep "Socket(s)" | cut -d':' -f2 | xargs)" | |
| 12 | + | echo "核心总数: $(lscpu | grep "^CPU(s):" | cut -d':' -f2 | xargs)" | |
| 13 | + | ||
| 14 | + | echo -e "\n=== 内存信息 ===" | |
| 15 | + | free -h | head -2 | |
| 16 | + | ||
| 17 | + | echo -e "\n=== 磁盘信息 ===" | |
| 18 | + | df -h | grep -E "(^Filesystem|^/dev/)" | |
| 19 | + | ||
| 20 | + | echo -e "\n=== 当前负载 ===" | |
| 21 | + | w | head -1 | |
| 22 | + | ||