<>Ubuntu 查看cpu个数及核心数
总核数 = 物理CPU个数 X 每颗物理CPU的核数 总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数
<>查看CPU型号
cat /proc/cpuinfo | grep 'model name' |uniq # model name : Intel(R) Core(TM)
i9-7900X CPU @ 3.30GHz grep "model name" /proc/cpuinfo |awk -F ':' '{print $NF}'
# 输出如下 Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Intel(R) Core(TM) i9-7900X CPU @
3.30GHz Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Intel(R) Core(TM) i9-7900X CPU
@3.30GHz Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Intel(R) Core(TM) i9-7900X
CPU @3.30GHz Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Intel(R) Core(TM) i9-
7900X CPU @3.30GHz Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Intel(R) Core(TM) i9
-7900X CPU @ 3.30GHz Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Intel(R) Core(TM)
i9-7900X CPU @ 3.30GHz Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Intel(R) Core(TM
) i9-7900X CPU @ 3.30GHz Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Intel(R) Core(
TM) i9-7900X CPU @ 3.30GHz Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Intel(R)
Core(TM) i9-7900X CPU @ 3.30GHz Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz Intel(R
) Core(TM) i9-7900X CPU @ 3.30GHz
<>查看物理CPU个数
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
<>查看每个物理CPU中core的个数(即核数)
cat /proc/cpuinfo| grep "cpu cores"| uniq
<>查看逻辑CPU的个数
cat /proc/cpuinfo| grep "processor"| wc -l
<>查看线程数
grep 'processor' /proc/cpuinfo | sort -u | wc -l
注意,此处查看的线程数是总的线程数,可以理解为逻辑cpu的数量

技术
今日推荐
阅读数 171920
阅读数 112
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:766591547
关注微信