Linux查看CPU信息
1. 查询CPU型号
cat /proc/cpuinfo | grep 'model name' | sort | uniq
2. 查询CPU颗数
cat /proc/cpuinfo | grep 'physical id' | sort | uniq | wc -l
3. 查询CPU核数
cat /proc/cpuinfo |grep "cores"|uniq|awk '{print $4}'
4. 查询逻辑CPU核数
cat /proc/cpuinfo |grep "processor"|wc -l
5. 参考
https://colobu.com/2019/02/22/how-to-find-cpu-cores-in-linux/
https://stackoverflow.com/questions/6481005/how-to-obtain-the-number-of-cpus-cores-in-linux-from-the-command-line
https://blog.csdn.net/dba_waterbin/article/details/8644626
https://www.zhihu.com/question/28472793

浙公网安备 33010602011771号