获取有关 CPU 的信息

fox*_*ot9 19 cpu cpuinfo

我是 Linux 和 Ubuntu 世界的新手。我想说获取有关 CPU 的最大信息。( cpufreq ,核心数,每核心线程数,指令集,缓存大小,指令集,虚拟化等)

我更喜欢一种适用于所有 Linux 发行版而不是 Ubuntu 特定方法的方法。

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:    2
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 69
Stepping:              1
CPU MHz:               989.531
BogoMIPS:              4788.74
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0-3
Run Code Online (Sandbox Code Playgroud)

运行sudo lscpu返回相同。

Ram*_*and 22

您可以通过执行来检查型号

cat /proc/cpuinfo | grep 'model name' | uniq
Run Code Online (Sandbox Code Playgroud)

输出:

 model name      : Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
Run Code Online (Sandbox Code Playgroud)

计算 CPU 数量:

cat /proc/cpuinfo | grep processor
Run Code Online (Sandbox Code Playgroud)

输出

2
Run Code Online (Sandbox Code Playgroud)

核对核数!

cat /proc/cpuinfo | grep 'core id'
core id         : 0
core id         : 1

$hardinfo | less


$nproc  / prints out the number of processing units
Run Code Online (Sandbox Code Playgroud)

对于Windows 用户,在此处使用 CPU-Z

有关 Windows 和 linux 的更多信息,请参见此处