亚洲欧美精品沙发,日韩在线精品视频,亚洲Av每日更新在线观看,亚洲国产另类一区在线5

<pre id="hdphd"></pre>

  • <div id="hdphd"><small id="hdphd"></small></div>
      學(xué)習(xí)啦>學(xué)習(xí)電腦>操作系統(tǒng)>Linux教程>

      Linux怎么查看物理CPU個數(shù)

      時間: 春健736 分享

        在linux中我們對于硬件的查看只能通過命令的方式來獲得了不能直接查看到了,下面學(xué)習(xí)阿拉小編給各位整理了一些Linux查看物理CPU個數(shù)、核數(shù)、邏輯CPU個數(shù)的命令供各位學(xué)習(xí)。

        Linux怎么查看物理CPU個數(shù)

        查看邏輯CPU個數(shù):

        #cat /proc/cpuinfo |grep "processor"|sort -u|wc -l

        24

        查看物理CPU個數(shù):

        #grep "physical id" /proc/cpuinfo|sort -u|wc -l

        2

        #grep "physical id" /proc/cpuinfo|sort -u

        physical id : 0

        physical id : 1

        查看每個物理CPU內(nèi)核個數(shù):

        #grep "cpu cores" /proc/cpuinfo|uniq

        cpu cores : 6

        每個物理CPU上邏輯CPU個數(shù):

        #grep "siblings" /proc/cpuinfo|uniq

        siblings : 12

        判斷是否開啟了抄超線程:

        如果多個邏輯CPU的"physical id"和"core id"均相同,說明開啟了超線程

        或者換句話說

        邏輯CPU個數(shù) > 物理CPU個數(shù) * CPU內(nèi)核數(shù) 開啟了超線程

        邏輯CPU個數(shù) = 物理CPU個數(shù) * CPU內(nèi)核數(shù) 沒有開啟超線程

        一次性查詢所有信息:

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      #!/bin/bash
       
      physicalNumber=0
      coreNumber=0
      logicalNumber=0
      HTNumber=0
       
      logicalNumber=$(grep "processor" /proc/cpuinfo|sort -u|wc -l)
      physicalNumber=$(grep "physical id" /proc/cpuinfo|sort -u|wc -l)
      coreNumber=$(grep "cpu cores" /proc/cpuinfo|uniq|awk -F':' '{print $2}'|xargs)
      HTNumber=$((logicalNumber / (physicalNumber * coreNumber)))
       
      echo "****** CPU Information ******"
      echo "Logical CPU Number  : ${logicalNumber}"
      echo "Physical CPU Number : ${physicalNumber}"
      echo "CPU Core Number     : ${coreNumber}"
      echo "HT Number           : ${HTNumber}"
       
      echo "*****************************"

        執(zhí)行結(jié)果:

        #./cpuinfo

        ****** CPU Information ******

        Logical CPU Number : 24

        Physical CPU Number : 2

        CPU Core Number : 6

        HT Number : 2

      看過“ Linux怎么查看物理CPU個數(shù) ”的人還看了:

      1.linux查看多個cpu信息

      2.電腦CPU怎么查看

      3.linux下如何看每個CPU的使用率

      4.uptime詳解,最通俗的說明了cpu平均負(fù)載

      5.linux系統(tǒng)如何查看內(nèi)存使用情況

      Linux怎么查看物理CPU個數(shù)

      在linux中我們對于硬件的查看只能通過命令的方式來獲得了不能直接查看到了,下面學(xué)習(xí)阿拉小編給各位整理了一些Linux查看物理CPU個數(shù)、核數(shù)、邏輯CPU個數(shù)的命令供各位學(xué)習(xí)。 Linux怎么查看物理CPU個數(shù) 查看邏輯CPU個數(shù): #cat /proc/cpui
      推薦度:
      點擊下載文檔文檔為doc格式

      精選文章

      • vim編輯命令怎么使用
        vim編輯命令怎么使用

        vim是一個全屏編輯器,模式化編輯器。模式主要有編輯模式,輸入模式,末行模式。默認(rèn)打開vim命令進(jìn)入的是編輯模式。下面跟著學(xué)習(xí)啦小編一起來了解一

      • Linux的進(jìn)程知識介紹
        Linux的進(jìn)程知識介紹

        同一個程序可以執(zhí)行多次,每次都可以在內(nèi)存中開辟獨立的空間來裝載,從而產(chǎn)生多個進(jìn)程。不同的進(jìn)程還可以擁有各自獨立的IO接口。

      • Linux rz命令怎么使用
        Linux rz命令怎么使用

        在Linux中rz 和 sz 命令允許開發(fā)板與主機(jī)通過串口進(jìn)行傳遞文件了,下面學(xué)習(xí)啦小編就來簡單的介紹一下rz 的使用方法。 Linux rz命令怎么使用 rz命令可以批量

      • LINUX防火墻常用操作
        LINUX防火墻常用操作

        學(xué)習(xí)啦小編來給大家介紹下LINUX防火墻常用操作,對于自己學(xué)習(xí)使用Linux更有幫助。下面跟著學(xué)習(xí)啦小編一起來了解一下吧。 LINUX防火墻常用操作 (1) 重啟后

      646848