shell查看系统基本信息脚本

#!/bin/bash
echo "IP:"
ifconfig |grep "inet addr"|grep -v 127.0.0.1|awk '{print $2}'|awk -F ':' '{print $2}'
echo "Product Name:"
dmidecode |grep Name
echo "CPU Info:"
dmidecode |grep -i cpu|grep -i version|awk -F ':' '{print $2}'
echo "Disk Info:"
fdisk -l|grep "Disk"|awk -F ',' '{print "	",$1}'
echo "Network Info:"
lspci |grep Ethernet
echo "Memory Info:"
dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v No
echo "Memory number:"`dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v No|wc -l`

posted @ 2017-04-29 20:09  claireyuancy  阅读(509)  评论(0编辑  收藏  举报