User Tools

Site Tools


ubuntu:cpu:display_the_number_of_processors

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:cpu:display_the_number_of_processors [2020/07/15 09:30] – external edit 127.0.0.1ubuntu:cpu:display_the_number_of_processors [2021/06/22 11:22] (current) peter
Line 2: Line 2:
  
 To display the number of CPUs. To display the number of CPUs.
 +
 +----
 +
 +===== Using /proc/cpuinfo =====
  
 <code bash> <code bash>
Line 7: Line 11:
 </code> </code>
  
-**/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.+returns: 
 + 
 +<code bash> 
 +24 
 +</code> 
 + 
 + 
 +<WRAP info> 
 +**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. 
 +</WRAP> 
 + 
 +---- 
 + 
 +===== Using lscpu ===== 
 + 
 +<code bash> 
 +lscpu | egrep 'CPU\(s\)' 
 +</code> 
 + 
 +returns: 
 + 
 +<code bash> 
 +CPU(s):                          24 
 +On-line CPU(s) list:             0-23 
 +NUMA node0 CPU(s):               0-23 
 +</code> 
 + 
 +---- 
 + 
 +===== Using nproc ===== 
 + 
 +<code bash> 
 +nproc 
 +</code> 
 + 
 +returns: 
 + 
 +<code bash> 
 +24 
 +</code> 
ubuntu/cpu/display_the_number_of_processors.1594805433.txt.gz · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki