cpu相关信息所在文件是 /proc/cpuinfo
物理cpu数
# grep "physical id" /proc/cpuinfo | sort | uniq | wc -l
cpu 核数
# grep 'cpu cores' /proc/cpuinfo | uniq | awk -F':' '{print $2}'
逻辑cpu数
# grep 'processor' /proc/cpuinfo | sort | wc -l