脚本
#!/bin/bash cpu=` cat /proc/cpuinfo | grep processor -c` mem=$( cat /proc/meminfo | awk '/MemTotal/{print int($2/1024/1024)+1"G"}') disk=`fdisk -l|grep "Disk /dev/sdb"|awk '{print $3}'` echo "${cpu}C+${mem}+${disk}"