① 查看物理CPU的个数
$ cat /proc/cpuinfo | grep "physical id"| sort | uniq | wc -l
# 2
② 查看逻辑CPU的个数
$ cat /proc/cpuinfo | grep "processor"|wc -l
# 24
③ 查看CPU是几核
$ cat /proc/cpuinfo | grep "cores" | uniq
# 6
① 查看物理CPU的个数
$ cat /proc/cpuinfo | grep "physical id"| sort | uniq | wc -l
# 2
② 查看逻辑CPU的个数
$ cat /proc/cpuinfo | grep "processor"|wc -l
# 24
③ 查看CPU是几核
$ cat /proc/cpuinfo | grep "cores" | uniq
# 6