Linux查看cpu個(gè)數(shù)
Linux查看cpu個(gè)數(shù)
CPU是電腦的重要組成部分,是不可缺少的角色。下面是學(xué)習(xí)啦小編帶來(lái)的關(guān)于Linux查看cpu個(gè)數(shù)的內(nèi)容,歡迎閱讀!
Linux查看cpu個(gè)數(shù):
Java代碼
[root@lidongbo~]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Pentium(R) Dual CPU E2200 @ 2.20GHz
stepping : 13
cpu MHz : 2200.010
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl est tm2 cx16 xtpr lahf_lm
bogomips : 4403.65
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Pentium(R) Dual CPU E2200 @ 2.20GHz
stepping : 13
cpu MHz : 2200.010
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl est tm2 cx16 xtpr lahf_lm
bogomips : 4399.94
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
[root@lidongbo ~]#
通過(guò)上面信息我們可以知道
從processor 0 到processor 1可以看出來(lái)總共有2個(gè)核
從physical id : 0 可以看出有一個(gè)cpu(因?yàn)闆](méi)發(fā)現(xiàn)physical id : 1)
從cpu cores : 2 可以看出cpu有兩個(gè)內(nèi)核
簡(jiǎn)單點(diǎn)
1. 查看物理CPU的個(gè)數(shù)
#cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l
2. 查看邏輯CPU的個(gè)數(shù)
#cat /proc/cpuinfo |grep "processor"|wc -l
3. 查看CPU是幾核
#cat /proc/cpuinfo |grep "cores"|uniq
4. 查看CPU的主頻
#cat /proc/cpuinfo |grep MHz|uniq
看了Linux查看cpu個(gè)數(shù)文章內(nèi)容的人還看: