在CentOS Linux 7.x上如何查看CPU信息

时间:2019-11-20 08:53:53  来源:igfitidea点击:

在CentOS Linux 5.x/6.x/7上,如何使用命令查看有关CPU的信息,比如内核,插槽,CPU类型,品牌等?
在Linux中,如何查看CPU相关的信息?

在CentOS Linux 7.x上查找CPU信息

在CentOS Linux上查看CPU体系结构的信息:

[root@centos7 ~]# lscpu

输出示例:

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 71
Model name:            Intel(R) Xeon(R) CPU E3-1285L v4 @ 3.40GHz
Stepping:              1
CPU MHz:               3796.154
CPU max MHz:           3800.0000
CPU min MHz:           800.0000
BogoMIPS:              6784.29
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
L4 cache:              131072K
NUMA node0 CPU(s):     0-7
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb intel_pt ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt dtherm ida arat pln pts spec_ctrl intel_stibp flush_l1d

CentOS Linux查看CPU信息

另一中方法是查看/proc/cpuinfo文件

[root@centos7 ~]# cat /proc/cpuinfo

CentOS Linux查看CPU的有关信息

查看CentOS Linux服务器中的物理CPU数量:

[root@centos7 ~]# grep physical.id /proc/cpuinfo | sort -u | wc -l

查看CPU的内核数:

[root@centos7 ~]# grep cpu.cores /proc/cpuinfo | sort -u

统计逻辑处理器的数量:

[root@centos7 ~]# grep processor /proc/cpuinfo | wc -l

使用dmidecode命令查看CPU的信息:

[root@centos7 ~]# dmidecode -t4

CentOS Linux 7.x上查看服务器CPU的插槽数

将grep命令与wc命令和sort命令一起使用,如下所示:

[root@centos7 ~]# grep physical.id /proc/cpuinfo | sort -u | wc -l

或使用lscpu命令:

[root@centos7 ~]# lscpu | grep -i "socket(s)"