We can use the cat command to view it. The cat command is used to connect files and print to the standard output device.
To check how many cores the CPU has, the command is as follows:
#cat /proc/cpuinfo |grep "cores"|uniq
Extension:
Check the number of physical CPUs
#cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l
Check the number of logical CPUs Number
#cat /proc/cpuinfo |grep "processor"|wc -l
Recommended tutorial: linux tutorial
The above is the detailed content of How to check how many cores a CPU has in Linux. For more information, please follow other related articles on the PHP Chinese website!