1、查看CPU型号
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
示例:
[root@n13 log]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
32 Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
2、查看物理CPU个数
cat /proc/cpuinfo| grep "physical id" | sort | uniq | wc -l
示例:
[root@n13 log]# cat /proc/cpuinfo| grep "physical id" | sort | uniq | wc -l
2
3、查看逻辑CPU的个数
cat /proc/cpuinfo| grep "processor" | wc -l
示例:
[root@n13 log]# cat /proc/cpuinfo| grep "processor" | wc -l
32
4、查看每个物理CPU中core的个数(即核数)
cat /proc/cpuinfo | grep "cpu cores" | uniq
示例:
[root@n13 log]# cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores : 8