#查看CPU信息(型号)
[root@AAA ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
4 Intel(R) Xeon(R) CPU E5-2403 v2 @ 1.80GHz
# 查看物理CPU个数
[root@AAA ~]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
1
# 查看每个物理CPU中core的个数(即核数)
[root@AAA ~]# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores : 4
# 查看逻辑CPU的个数
[root@AAA ~]# cat /proc/cpuinfo| grep "processor"| wc -l
4
#查看CPU的各项指标
[root@AAA ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 62
Stepping: 4
CPU MHz: 1800.057
BogoMIPS: 3600.11
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 10240K
NUMA node0 CPU(s): 0-3
[root@test ~]# lscpu
Architecture: x86_64 # CPU架构
CPU(s): 48 # 逻辑CPU个数
On-line CPU(s) list: 0-47 # 在线的CPU数量,有时为了省电或者CPU过热,某些CPU会停止运行
Thread(s) per core: 2 # 每个核心的线程数是2
Core(s) per socket: 12 # 每颗CPU的核数是12
# PS:共2颗CPU,单颗CPU是12核,每个核的线程数是2,那总的逻辑CPU核数就是48=2*12*2