Linux查看CPU信息详解
Linux查看CPU信息
首先,大家如果看到有什么不懂的地方,欢迎吐槽!!!
参数说明:
- Physical id 相同表示为同一个物理CPU
- Processor 表示逻辑CPU
- Cpu cores CPU核数,内核个数
- Core id 内核id号
- Siblings 每个物理CPU里面的逻辑CPU个数
物理CPU 两个
processor 0 processor 2 processor 4 processor 6 core id 0 core id 2 core id 1 core id 3 physical 0 physical 0 physical 0 physical 0 cpu cores 4 cpu cores 4 cpu cores 4 cpu cores 4 siblings 4 siblings 4 siblings 4 siblings 4 processor 1 processor 3 processor 5 processor 7 core id 0 core id 2 core id 1 core id 3 physical 1 physical 1 physical 1 physical 1 cpu cores 4 cpu cores 4 cpu cores 4 cpu cores 4 siblings 4 siblings 4 siblings 4 siblings 4
计算是否开启超线程
逻辑CPU > 物理CPU x CPU核数 #开启超线程 逻辑CPU = 物理CPU x CPU核数 #没有开启超线程或不支持超线程
查看物理CPU个数
cat /proc/cpuinfo | grep “physical id” | sort -u | wc -l 2
查看逻辑CPU个数
cat /proc/cpuinfo | grep “processor” | wc -l 8
查看CPU内核数
cat /proc/cpuinfo | grep “cpu cores” | uniq 4
查看单个物理CPU封装的逻辑CPU数量
cat /proc/cpuinfo | grep “siblings” | uniq 4
script查看CPU信息
#!/bin/bash physical=$(cat /proc/cpuinfo | grep "physical id" | sort -u | wc -l) processor=$(cat /proc/cpuinfo | grep "processor" | wc -l) cpucores=$(cat /proc/cpuinfo | grep "cpu cores" | uniq) siblings=$(cat /proc/cpuinfo | grep "siblings" | uniq) echo "* * * * * CPU Information is a : * * * * *" echo "physical id is a : $physical" echo "processor is a : $processor" echo "cpu cores is a : $cpucores" echo "siblings is a : $siblings"
判断CPU是32位的还是64位的
cat /proc/cpuinfo | grep lm 8 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 pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx tm2 ssse3 cx16 xtpr pdcm dca sse4_1 xsave lahf_lm dts tpr_shadow vnmi flexpriority lm 表示Long Mode - 64位CPU
判断系统是32位的还是64位的
相关推荐
sjpeter 2020-06-11
85231843 2019-12-11
风月无古今 2020-06-28
womystery 2020-05-13
jingtao 2020-04-26
cas的无名 2020-02-18
fylong 2020-01-29
加油奋斗吧 2020-01-17
lihy0 2020-01-09
阿债的方寸天地 2020-01-03
zrenpro 2013-07-31
xiaohouye 2019-12-26
fenxinzi 2019-12-26
好好学习天天 2019-12-12
LychieFan 2015-03-19
zzydy 2015-04-24
linjava 2015-08-17
lishupeng0 2015-07-08