物理CPU个数
cat /proc/cpuinfo | grep “cpu cores” | sort | uniq | wc -l
每个物理CPU的core数量,即核数
cat /proc/cpuinfo | grep “cpu cores” | uniq
逻辑CPU个数
cat /proc/cpuinfo | grep “processor” | wc -l
参考:https://blog.csdn.net/yzf279533105/article/details/108779925