Use the lscpu command to get CPU/Processor information on Linux
There are a lot of ways to get information about your system’s cpu. You can either dump the contents of /proc/cpuinfo file, lshw or my recent discovery "lscpu". This utility gathers all the data from sysfs, /proc/cpuinfo file as well and shows it in a human readable format.
It doesn’t show a lot of information as compared to its other alternatives but this is usually all you need.
[shredder12]$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
CPU(s): 2
Thread(s) per core: 1
Core(s) per socket: 2
CPU socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 15
Stepping: 13
CPU MHz: 800.000
L1d cache: 32K
L1i cache: 32K
L2 cache: 2048K
If you need parsable info for your code then use the “-p” option.



























Post new comment