linux shell 检测
#!/bin/bashPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATH#看系统版本versions=`cat /etc/redhat-release |awk \'{print \"version is:\" $1\"-\"$4}\' |awk -F \'.\' \'{print $1\".\"$2}\'`#看磁盘使用情况disks=`fdisk -l |grep \"Disk\" |grep -n \"sectors$\" |sed -e \"s/:/-/g\" -e \"s/,//g\" |awk \'{print \"disk is:\" $2 $3 $4}\'`#看内存mens=`free -h |sed -n \"2p\" |awk \'{print \"men free is:\"\"\\n\" \"total-\"$2 \"\\n\" \"used-\"$3\"\\n\" \"free-\" $4}\'`#看cpucpus=`cat /proc/cpuinfo |grep \"physical id\" |sort |uniq -c|awk \'{print \"CPU:\" \"\\n\" $2,$NF,\"\\n\" \"Core:\"$1}\'`#查看当前操作系统平machines=`dmidecode |grep \"Product Name\" |sed -ne \"1p\" |sed -e \"s/[\\t]//g\"`