[Shell Script] Commands to Get CPU Core Count

Tadashi Shigeoka ·  Fri, November 22, 2013

A memo on commands to get the CPU core count.

$ cat /proc/cpuinfo | grep processor
processor  : 0
processor  : 1
$ echo `grep -c ^processor /proc/cpuinfo`
2

Reference Articles

逆引きUNIXコマンド/CPUコア数を調べる - Linuxと過ごす

That’s all from the Gemba.