前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >查看CPU信息小脚本

查看CPU信息小脚本

作者头像
三杯水Plus
发布2018-11-14 15:25:00
9450
发布2018-11-14 15:25:00
举报
文章被收录于专栏:运维运维

# 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

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2012-12-14 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档