Linux: How many processors do I have?
by someguy on Sep.13, 2006, under Uncategorized
On Linux, you can get a ton of information about the physical hardware you are running right from the command line. Simply cat’ing /proc/cpuinfo will give you lots of gory details about the processors you have installed. Unfortunately, it gets a little confusing thanks to hyperthreading, dual cores, etc.. So here’s a simple command to find out how many physical processors you have installed.
$ dmesg | grep "Physical Processor" | awk '{ print $5 }' |sort -nu|wc -l