linux查看cpu个数,线程数及cpu型号

时间:2021-06-16 09:16:38

1.查看CPU逻辑id

grep 'physical id' /proc/cpuinfo | sort -u

physical id : 0
physical id : 1

2.查看物理CPU个数

$ cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l

2

3.查看每个物理CPU中core的个数

$ cat /proc/cpuinfo| grep "cpu cores"| uniq

cpu cores : 10

4.查看逻辑CPU的个数

$ cat /proc/cpuinfo| grep "processor"| wc -l

40

5.查看总线程数量

$ grep 'processor' /proc/cpuinfo | sort -u | wc -l

40

6.查看CPU信息(型号)

$ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

40  Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40GHz

引用自https://blog.csdn.net/qq_20641565/article/details/72832273