====== 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