


To specifically answer your question you tell how many cores you have by multiplying the number of cores you have per socket by the number of sockets you have.įor the example systems above the desktop has 4 cores: $ echo "Cores = $(( $(lscpu | awk '/^Socket\(s\)/') ))"Īnother useful utility is dmidecode which outputs per socket information.

For the desktop machine above this should match the 4 Core(s) per socket reported by lscpu: $ grep -m 1 'cpu cores' /proc/cpuinfo The cpu cores reported by /proc/cpuinfo corresponds to the Core(s) per socket reported by lscpu. The output of /proc/cpuinfo should match this information, for example on the desktop system above we can see there are 8 processors (CPUs) and 4 cores (core id 0-3): $ grep -E 'processor|core id' /proc/cpuinfo For the desktop machine above this should match the 8 CPU(s) reported by lscpu: $ nproc -all The output of nproc corresponds to the CPU count from lscpu. Here is an example from a desktop machine: $ lscpu | grep -E '^Thread|^Core|^Socket|^CPU\('Īnd a server: $ lscpu | grep -E '^Thread|^Core|^Socket|^CPU\(' Wa_cq_url: "/content/If you multiply these numbers you will get the number of CPUs on your system.ĬPUs = Threads per core X cores per socket X socketsĬPUs are what you see when you run htop (these do not equate to physical CPUs). Wa_audience: "emtaudience:business/btssbusinesstechnologysolutionspecialist/developer/softwaredeveloper", Wa_subject: "emtsubject:itinformationtechnology/codemodernization,emtsubject:itinformationtechnology/codemodernization/parallelcomputing,emtsubject:itinformationtechnology/codemodernization/parallelcomputing/vectorization", Wa_emtsubject: "emtsubject:itinformationtechnology/codemodernization/parallelcomputing,emtsubject:itinformationtechnology/codemodernization,emtsubject:itinformationtechnology/codemodernization/parallelcomputing/vectorization", Wa_curated: "curated:donotuseinexternalfilters/hidefromuam", Wa_emtcontenttype: "emtcontenttype:salesandmarketingmaterials/marketingtools/topicoverviews",
