教你如何在Linux上查看CPU信息(linux看cpu)
Linux 是用户友好的开源操作系统之一,在这个系统中,有很多命令可以帮助用户获取、查看和更改有关 CPU 信息的数据。本文将介绍教你如何在 Linux 上查看 CPU 信息的一些步骤。
首先,要查看 CPU 信息,你可以使用`cat /proc/cpulinfo`命令,它会列出当前 CPU 的类型、模型、架构、序列号、速度以及缓存大小等信息,如下所示:
# cat /proc/cpuinfo
processor : 0vendor_id : GenuineIntel
cpu family : 6model : 58
model name : Intel(R) Core(TM) i7-3520M CPU @ 2.90GHzstepping : 9
cpu MHz : 2394.000cache size : 4096 KB
另外,你还可以使用`lscpu`命令来获取有关 CPU 的更多信息,例如 CPU 的位宽,支持的指令集,地址大小,最大 CPU 数量等等,如下所示:
# lscpu
Architecture: x86_64Byte Order: Little Endian
CPU(s): 2On-line CPU(s) list: 0,1
Thread(s) per core: 2Core(s) per socket: 1
Socket(s): 1Model name: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
CPU family: 6CPU MHz: 2394.000
L1d cache: 32KL1i cache: 32K
L2 cache: 256KL3 cache: 4096K
NUMA node0 CPU(s): 0,1Flags: 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
最后,你也可以使用`dmidecode`命令来获取 CPU 的更多信息,如 CPU 类型、位宽、生产商、型号、序列号、速度等等,如下所示:
# dmidecode -t processor
# dmidecode 3.2Getting SMBIOS data from sysfs.
SMBIOS 2.6 present.
Handle 0x000E, DMI type 4, 42 bytesProcessor Information
Socket Designation: CPU Type: Central Processor
Family: Core i7 Manufacturer: GenuineIntel
ID: B1 06 02 00 FF FB EB BF Signature: Type 0, Family 6, Model 58, Stepping 9
Flags: FPU (Floating-point unit on-chip)
VME (Virtual mode extension) DE (Debugging extension)
PSE (Page size extension) TSC (Time stamp counter)
MSR (Model specific registers) PAE (Physical address extension)
MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported) SEP (Fast system call)
MTRR (Memory type range registers) PGE (Page global enable)
MCA (Machine check architecture) CMOV (Conditional move instruction supported)
PAT (Page attribute table) PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported) DS (Debug store)
ACPI (ACPI supported) MMX (MMX technology supported)
FXSR (FXSAVE and FXSTOR instructions supported) SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2) SS (Self-snoop)
HTT (Multi-threading) Version: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
Voltage: 1.2 V External Clock: 100 MHz
Max Speed: 2900 MHz Current Speed: 2900 MHz
Status: Populated, Scalable Upgrade: Socket LGA1399
L1 Cache Handle: 0x0005 L2 Cache Handle: 0x0006
L3 Cache Handle: 0x0007 Serial Number: Not Specified
Asset Tag: Fill By OEM Part Number: Not Specified
Core Count: 2 Core Enabled: 2
Thread Count: 4 Characteristics:
64-bit capable
综上所述,通过以上这些步骤,你可以很容易的查看 Linux 上的 CPU 信息。