Home>Article>Operation and Maintenance> How to check how many cores a CPU has in Linux

How to check how many cores a CPU has in Linux

王林
王林 Original
2020-05-16 13:21:10 4048browse

How to check how many cores a CPU has in Linux

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn