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:
- List CPU info
lscpu
This command will display the processor information of the server, including the number of cores, threads, etc.
- 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.
- number of processes
nproc
This command will directly output the number of cores on the server.