现在的位置: 首页 > 综合 > 正文

linux cpu count

2012年04月09日 综合 ⁄ 共 339字 ⁄ 字号 暂无评论

/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

给我留言

留言无头像?