To find the number of CPU cores on a Linux system, you can use the nproc
command. This command displays the number of processing units available to the current process.
To see the number of CPU cores on the system, you can run the following command:
nproc
This will display the number of CPU cores on the system.
Alternatively, you can use the lscpu
command to display detailed information about the CPU architecture and configuration of the system. To see the number of CPU cores using lscpu
, you can run the following command:
lscpu | grep '^CPU(s):' | awk '{print $2}'
This will display the number of CPU cores on the system.
You can also use the /proc/cpuinfo
file to find the number of CPU cores. This file contains information about the CPU architecture and configuration of the system. To see the number of CPU cores using /proc/cpuinfo
, you can run the following command:
grep -c ^processor /proc/cpuinfo
This will display the number of CPU cores on the system.