Debian CPUInfo 获取方法

1029
2025/4/7 6:31:56
栏目: 智能运维
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

在 Debian 系统中,可以使用 cat /proc/cpuinfo 命令来获取 CPU 的详细信息。这个命令会显示 CPU 的型号、频率、核心数、缓存大小、处理器供应商等信息。

示例输出

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 142
model name : Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
stepping : 6
microcode : 0x1
cpu MHz : 1600.000
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
cpuid level : 22
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts cpuid
bogomips : 3200.00

提取特定信息

  • 物理核心数和逻辑核心数

    cat /proc/cpuinfo | grep "core id" | wc -l # 物理核心数
    cat /proc/cpuinfo | grep "processor" | wc -l # 逻辑核心数
    
  • CPU 型号和频率

    cat /proc/cpuinfo | grep "model name"
    cat /proc/cpuinfo | grep "cpu MHz"
    
  • CPU 缓存大小

    cat /proc/cpuinfo | grep "cache size"
    
  • CPU 位数

    cat /proc/cpuinfo | grep "flags" | grep -c "lm"
    

    如果输出结果为 1,则表示 CPU 是 64 位;如果输出结果为 0,则表示 CPU 是 32 位。

  • CPU 架构

    cat /proc/cpuinfo | grep "arch"
    

辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读: debian docker如何更新docker