/proc/cpuinfo has the info you need to identify the number of processors, cores and threads.
To get the total number of processors/cpu cores:
grep -c processor /proc/cpuinfo
Total number of physical cpus:
grep "physical id" /proc/cpuinfo | sort -u | wc -l
Number of cores per cpu:
grep "cores" /proc/cpuinfo | sort -u
To check if hyperthreading is enabled:
grep "cores\|siblings" /proc/cpuinfo | sort -u
转载于:https://blog.51cto.com/cwind/812657
本文详细解析如何从Linux系统中的 /proc/cpuinfo 文件获取处理器、核心和线程的数量信息,包括物理CPU数量、核心数以及是否启用超线程技术。
1422

被折叠的 条评论
为什么被折叠?



