1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| #!/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 "*****************************"
|