How to check the number of cores on a Linux server?

In a Linux system, you can use the following command to check the number of cores on the server:

  1. List CPU info
lscpu

This command will display the processor information of the server, including the number of cores, threads, etc.

  1. Show me the information of the CPU.
cat /proc/cpuinfo

This command will display the CPU information of the server, with the “processor” field indicating the number of cores.

  1. number of processes
nproc

This command will directly output the number of cores on the server.

bannerAds