Created
May 21, 2017 10:05
-
-
Save futeng/5b5906b7b74184e71c11c8970da51278 to your computer and use it in GitHub Desktop.
Show HOST basic informations
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 | |
# Title: Show HOST basic informations | |
# Author: ifuteng@gmail.com | |
# Date: 2017/05/21 | |
# 1. 内核 | |
echo "Core: "`uname -a` | |
# 2. 操作系统 | |
echo "OS: "`head -n 1 /etc/issue` | |
# 3. CPU信息 | |
echo "CPU model: "`cat /proc/cpuinfo | grep "model name" | head -1 ` | |
echo "CPU processor: "`cat /proc/cpuinfo | grep processor | wc -l` | |
# 4. 内存 | |
echo `grep MemTotal /proc/meminfo` | |
echo `grep MemFree /proc/meminfo` | |
# 5. 磁盘信息 | |
# 6. 主机名称 | |
echo "hostname: `hostname`" | |
# 7. IP地址 | |
echo "IP: "`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"` | |
# 8. 当前系统负载 | |
echo "Load Average: "`cat /proc/loadavg` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment