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

查看CPU线程

#cat /proc/cpuinfo | grep name | cut -f2 -d: |uniq -c8  Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz

数字8也是为CPU线程

# cat /proc/cpuinfo | grep "physical id" | uniqphysical id     : 1

查看物理CPU  个数为1

cat /proc/cpuinfo | grep "core id" | sort | uniqcore id         : 0core id         : 1core id         : 10core id         : 9

cat /proc/cpuinfo | grep "cores" |uniqcpu cores       : 4

查看CPU核数 以上显示为4核

具有相同core id的CPU是同一个core的超线程