User Tools

Site Tools


ubuntu:cpu:display_the_number_of_processors

Ubuntu - CPU - Display the number of processors

To display the number of CPUs.


Using /proc/cpuinfo

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

returns:

24

NOTE: /proc/cpuinfo contains all of the processor information for all current processors in the system.

  • This will include the speed, and the amount of on-chip cache, processor architecture type, and the number of cores.

Using lscpu

lscpu | egrep 'CPU\(s\)'

returns:

CPU(s):                          24
On-line CPU(s) list:             0-23
NUMA node0 CPU(s):               0-23

Using nproc

nproc

returns:

24
ubuntu/cpu/display_the_number_of_processors.txt · Last modified: 2021/06/22 11:22 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki