搬运一下国外的帖子吧,中文搜索千篇一律是看/proc/cpuinfo,因为系统是英语写的,所以他们自然会对这些命令更熟悉
Check how many CPUs are there in Linux system
Author: Vivek Gite Last updated: October 15, 2018 0 comments
Introduction: One can obtain the number of CPUs or cores in Linux from the command line. The /proc/cpuinfo file stores CPU and system architecture dependent items, for each supported architecture. You can view /proc/cpuinfo with the help of cat command or grep command/egrep command. This page shows how to use /proc/cpuinfo file and lscpu command to display number of processo