I am trying to grab the number of sockets and core information. Till now I found that one socket can have multiple cores.

But my system shows:

root:~ #  dmidecode | grep "Central Processor" | wc -l
root:~ # grep processor /proc/cpuinfo | wc -l

Here, number of sockets is more than number of cores? How do I check empty sockets?

1 Answer 1


In dmidecode's output, you need to look for Status: Populated, Enabled in the socket information. So

dmidecode | grep -c "Status: Populated, Enabled"

should give you the correct result.

You'll find the same information in a more compact form with lscpu; this will give you (amongst other things) the number of on-line sockets, the number of cores per socket and the number of threads per core.

  • I got socket 2 from lscpu.
    – kinkajou
    Mar 18, 2015 at 9:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .