M BUZZ CRAZE NEWS
// general

How can I get the number of hardware level threads in my computer?

By Mia Morrison

How can I get the number of hardware level threads in my computer using the ubuntu terminal?

1 Answer

Using lscpu:

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 69
Stepping: 1
CPU MHz: 806.347
BogoMIPS: 4988.30
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
NUMA node0 CPU(s): 0-3

The OS recognizes each hardware thread as a different CPU. The number you want is show at line CPU(s):, which is the same as multiplying Thread(s) per core:, Core(s) per socket: and Socket(s):.

Or you can use a single command:

lscpu -p | grep -c "^[0-9]"

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy