Linux???cpu??????
???????????? ???????[ 2015/11/18 11:01:38 ] ??????????????
????1.?????CPU??????
????#cat /proc/cpuinfo |grep "processor"|sort -u|wc -l
????24
????2.?????г?????????б???????????CPU??????
????#grep "physical id" /proc/cpuinfo|sort -u|wc -l
????2
????#grep "physical id" /proc/cpuinfo|sort -u
????physical id : 0
????physical id : 1
?????????????CPU????????
????#grep "cpu cores" /proc/cpuinfo|uniq
????cpu cores : 6
???????????CPU?????CPU??????
????#grep "siblings" /proc/cpuinfo|uniq
????siblings : 12
?????ж???????????????
?????????????CPU??"physical id"??"core id"????????????????????
??????????仰?
???????CPU???? > ????CPU???? * CPU????? ??????????
???????CPU???? = ????CPU???? * CPU????? ??п???????
??????????????????
????????????????????
????#!/bin/bash
????physicalNumber=0
????coreNumber=0
????logicalNumber=0
????HTNumber=0
????logicalNumber=$(grep "processor" /proc/cpuinfo|sort -u|wc -l)
????physicalNumber=$(grep "physical id" /proc/cpuinfo|sort -u|wc -l)
????coreNumber=$(grep "cpu cores" /proc/cpuinfo|uniq|awk -F':' '{print $2}'|xargs)
????HTNumber=$((logicalNumber / (physicalNumber * coreNumber)))
????echo "****** CPU Information ******"
????echo "Logical CPU Number : ${logicalNumber}"
????echo "Physical CPU Number : ${physicalNumber}"
????echo "CPU Core Number : ${coreNumber}"
????echo "HT Number : ${HTNumber}"
????echo "*****************************"
??????н????
????#./cpuinfo
????****** CPU Information ******
????Logical CPU Number : 24
????Physical CPU Number : 2
????CPU Core Number : 6
????HT Number : 2
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11