查看CPU信息小脚本

# cat cpuinfo.sh 

#!/bin/bash

echo "                  the `hostname` cpuinfo                       "

echo "the cpu stype:"

echo "`dmidecode -s processor-version | head -n 1`"

echo "the physical cpu is:"

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

echo "the cores is:"

cat /proc/cpuinfo  | grep "cpu core" |awk '{print $4}'|head -n 1

echo "the siblings is:"

cat /proc/cpuinfo  | grep siblings |awk '{print $3}'|head -n 1

echo "the logic cpu is:"

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

echo "if the logic is not physical x cores, the cpu is super-threading."

echo "the cpu support:"

cat /proc/cpuinfo | grep flags | awk -F: '{print $2}'|sort|uniq

[root@bjicqh910 ~]# ./cpuinfo.sh 

                  the server cpuinfo                       

the cpu stype:

Intel(R) Xeon(R) CPU           X5690  @ 3.47GHz

the physical cpu is:

2

the cores is:

6

the siblings is:

12

the logic cpu is:

24

if the logic is not physical x cores, the cpu is super-threading.

the cpu support:

 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 pdpe1gb rdtscp lm constant_tsc ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区

领取腾讯云代金券