How to Check Number of Processors on Linux

Determining Processor Count on Linux Systems
Whether you’ve recently updated your Linux operating system or simply need to ascertain the processor specifications of a remote server, a straightforward command can be employed to reveal the number of processors.
On Linux systems, the file located at /proc/cpuinfo serves as a repository for comprehensive processor details concerning all currently active processors within your machine.
This information encompasses processor speed, the size of the on-chip cache, the processor type, and the number of cores present.
The Command to Use
The following command facilitates the retrieval of this information:
cat /proc/cpuinfo | grep processor | wc -l
This command functions by examining the /proc/cpuinfo file, extracting lines that include the term "processor," and then piping this output to the wc (word count) utility.
The wc utility subsequently provides a numerical count representing the total number of CPUs detected within the system.
Example Output
Below is an example of the command’s output as observed on a remote server:
[root@root]# cat /proc/cpuinfo | grep processor | wc -l
4
This indicates that the server possesses four processors.
Understanding Core Count
It’s important to note that if your system is equipped with a dual-core processor, each core will be reported as an individual processor by this command.
To determine whether your processor features multiple cores, a thorough review of the complete output generated by cat /proc/cpuinfo is recommended.
This detailed output will provide insights into the specific characteristics of your processor, including its core configuration.