centos

centos cpuinfo命令使用技巧

小樊
42
2025-08-02 13:54:33
栏目: 智能运维

lscpu 是 CentOS 中用于显示 CPU 架构信息的命令行工具。它可以提供关于 CPU 的详细信息,包括型号、核心数、线程数、缓存大小等。以下是一些常用的 lscpu 命令及其使用技巧:

基本用法

  1. 查看所有 CPU 信息

    lscpu
    
  2. 查看 CPU 架构信息

    lscpu | grep Architecture
    
  3. 查看 CPU 核心数

    lscpu | grep '^CPU(s):'
    
  4. 查看物理核心数

    lscpu | grep 'Physical id'
    
  5. 查看逻辑核心数

    lscpu | grep 'Thread(s) per core'
    
  6. 查看每个物理核心的线程数

    lscpu | grep 'Core(s) per socket'
    
  7. 查看 CPU 缓存信息

    lscpu | grep 'L3 Cache'
    

高级用法

  1. 查看 CPU 的详细信息

    lscpu -v
    
  2. 查看 CPU 的型号名称

    lscpu | grep 'Model name'
    
  3. 查看 CPU 的最大频率和最小频率

    lscpu | grep 'MHz'
    
  4. 查看 CPU 的供应商 ID

    lscpu | grep 'Vendor ID'
    
  5. 查看 CPU 的地址大小

    lscpu | grep 'Address sizes'
    
  6. 查看 CPU 的扩展功能

    lscpu | grep 'Flags'
    

示例输出

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:                 158
Stepping:              9
CPU MHz:               2400.000
CPU max MHz:           3600.0000
CPU min MHz:           800.0000
BogoMIPS:              4798.09
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              8192K
NUMA node0 CPU(s):     0-7

通过这些命令和输出,你可以全面了解你的 CentOS 系统中 CPU 的详细信息。

0
看了该问题的人还看了