Linux檢視機器是幾核的

2021-10-02 13:25:05 字數 1776 閱讀 8631

幾個cpu

more /proc/cpuinfo |grep "physical id"|uniq|wc -l

每個cpu是幾核(假設cpu配置相同)

more /proc/cpuinfo |grep "physical id"|grep "0"|wc -l

cat /proc/cpuinfo | grep processor

1. 檢視物理cpu的個數

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

2. 檢視邏輯cpu的個數

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

3. 檢視cpu是幾核

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

4. 檢視cpu的主頻

#cat /proc/cpuinfo |grep mhz|uniq

#uname -a

linux euis1 2.6.9-55.elsmp #1 smp fri apr 20 17:03:35 edt 2007 i686 i686 i386 gnu/linux

(檢視當前作業系統核心資訊)

#cat /etc/issue | grep linux

red hat enterprise linux as release 4 (nahant update 5)

(檢視當前作業系統發行版資訊)

#cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

8  intel(r) xeon(r) cpu            e5410   @ 2.33ghz

(看到有8個邏輯cpu, 也知道了cpu型號)

#cat /proc/cpuinfo | grep physical | uniq -c

4 physical id      : 0

4 physical id      : 1

(說明實際上是兩顆4核的cpu)

#getconf long_bit

(說明當前cpu執行在32bit模式下, 但不代表cpu不支援64bit)

#cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l

(結果大於0, 說明支援64bit計算. lm指long mode, 支援lm則是64bit)

如何獲得cpu的詳細資訊:

linux命令:cat /proc/cpuinfo

用命令判斷幾個物理cpu,幾個核等:

邏輯cpu個數:

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

物理cpu個數:

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

每個物理cpu中core的個數:

# cat /proc/cpuinfo | grep "cpu cores" | wc -l

是否為超執行緒?

如果有兩個邏輯cpu具有相同的」core id」,那麼超執行緒是開啟的。

每個物理cpu中邏輯cpu(可能是core, threads或both)的個數:

# cat /proc/cpuinfo | grep "siblings"

linux 下檢視機器是幾核的

linux 下檢視機器是cpu是幾核的 幾個cpu more proc cpuinfo grep physical id uniq wc l 每個cpu是幾核 假設cpu配置相同 more proc cpuinfo grep physical id grep 0 wc l cat proc cpui...

linux 下檢視機器是cpu是幾核的

幾個cpu more proc cpuinfo grep physical id uniq wc l 每個cpu是幾核 假設cpu配置相同 more proc cpuinfo grep physical id grep 0 wc l cat proc cpuinfo grep processor 1...

linux 下檢視機器是cpu是幾核的

檢視各cpu狀況,top 然後按1 1.檢視物理cpu的個數 cat proc cpuinfo grep physical id sort uniq wc l 2.檢視邏輯cpu的個數 cat proc cpuinfo grep processor wc l 3.檢視cpu是幾核 cat proc ...