I am running the following command to get the number of processors/cores in Linux:
cat /proc/cpuinfo | grep processor | wc -l
It works but it does not look elegant. How would you suggest improve it ?
Press the Windows key + R to open the Run command box, then type msinfo32 and hit Enter. It should open up the System Information app. Select Summary and scroll down until you find Processor. The details will tell you both how many cores and logical processors your CPU has.
Alternatively, you can press Ctrl + Shift + Esc to bring up the Task Manager window, then click on the Performance tab (second from the left). At the top right, you'll see the name of your processor and the number of cores that it has.
The top command is used to display the dynamic real-time view of all running processes in your system. To find out the CPU cores, run top command and press "1" (Number one) to get the CPU core details.
nproc
is what you are looking for.
More here : http://www.cyberciti.biz/faq/linux-get-number-of-cpus-core-command/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With