Find CPU Cores – How to Find Number of CPU Cores Including Virtual

command linecpuinfosystem-info

How do I find out the number of cores my CPU has, including virtual cores (hyper threading cores) using the command line?

Best Answer

You can count no of CPUs

cat /proc/cpuinfo | grep processor | wc -l

Output :

2

To check the number of cores !

cat /proc/cpuinfo | grep 'core id'
core id         : 0
core id         : 1

Or

 $ nproc
 2

Or lscpu will show you all output:

lscpu

Architecture:          i686
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            15
Model:                 4
Stepping:              7
CPU MHz:               2792.992
BogoMIPS:              5585.98
L1d cache:             16K
L2 cache:              1024K
Related Question