Michael Michael - 1 year ago 91
Linux Question

Number of processors/cores in command line

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 ?

Answer Source

nproc is what you are looking for.

More here : http://www.cyberciti.biz/faq/linux-get-number-of-cpus-core-command/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download