①物理cpu數:主板上實際插入的cpu數量,可以數不重復的 physical id 有幾個(physical id)
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
②cpu核數:單塊CPU上面能處理數據的芯片組的數量,如雙核、四核等 (cpu cores)
cat /proc/cpuinfo| grep "cpu cores"| uniq
③邏輯cpu數:簡單來說,它可使處理器中的1顆內核,如2顆內核那樣在操作系統中發揮作用。
cat /proc/cpuinfo| grep "processor"| wc -l
④查看cpu信息(型號)
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
xxxx@ubuntu:~$ free -m
total used free shared buff/cache available
Mem: 64391 12022 1280 20 51087 51664
Swap: 15258 510 14748
xxxx@ubuntu:~$ cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
2
xxxx@ubuntu:~$ cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores : 10
xxxx@ubuntu:~$ cat /proc/cpuinfo | grep "processor" | wc -l
40
xxxx@ubuntu:~$ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
40 Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
總核數 = 物理CPU個數 × 每顆物理CPU的核數;
總邏輯CPU數 = 物理CPU個數 ×每顆物理CPU的核數 × 超線程數。
結論:所以這算雙核的。