温馨提示×

CPUInfo 命令在 Linux 中如何使用

小樊
47
2025-07-10 03:52:43
栏目: 智能运维

lscpu 是一个在 Linux 中查看 CPU 信息的命令,而不是 CPUInfo

要使用 lscpu 命令,请按照以下步骤操作:

  1. 打开终端(Terminal)。
  2. 输入 lscpu 命令,然后按 Enter 键。

这将显示有关 CPU 架构、型号、核心数、线程数、缓存大小等详细信息。输出结果类似于以下内容:

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:                 158
Model name:            Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Stepping:              9
CPU MHz:               800.000
BogoMIPS:              5600.00
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
NUMA node0 CPU(s):     0-3

如果您需要更详细的信息,可以使用 lscpu 命令的其他选项。例如,要查看 JSON 格式的输出,可以使用以下命令:

lscpu --json

要查看特定属性,例如 CPU 核心数,可以使用 grep 命令过滤输出结果:

lscpu | grep '^CPU(s):'

这将显示 CPU 核心数。

0