Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

【信息】CPU cat /proc/cpuinfo

  • 主要记录在文件 /proc/cpuinfo

  • 型号

    cat /proc/cpuinfo | grep name
    
  • 数量

    • 物理CPU个数

      cat /proc/cpuinfo | grep "physical id"  
      
    • 逻辑CPU个数

      cat /proc/cpuinfo | grep "processor"
      
    • CPU内核数

      cat /proc/cpuinfo | grep "cpu cores"
      
    • 单个物理CPU封装的逻辑CPU数量

      cat /proc/cpuinfo | grep "siblings"
      
  • 统计计数

    • 加后缀
      | wc -l
      
  • 计算超线程

    • 若 逻辑CPU > 物理CPU x CPU核数
      • 代表 开启了超线程
    • 若 逻辑CPU = 物理CPU x CPU核数
      • 代表 没有开启超线程或不支持超线程*