Linux cpu processor cores and threads

/proc/cpuinfo has the info you need to identify the number of processors, cores and threads.

To get the total number of processors/cpu cores:

grep -c processor /proc/cpuinfo

Total number of physical cpus:

grep "physical id" /proc/cpuinfo | sort -u | wc -l

Number of cores per cpu:

grep "cores" /proc/cpuinfo | sort -u

To check if hyperthreading is enabled:

grep "cores\|siblings" /proc/cpuinfo | sort -u

If siblings is a multiple of cores then hyperthreading is enabled.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Great post

Thanks for these man, this is exactly what I was looking for!

Comment