CPU Info on Linux: Check CPU Details from the Command Line

By 

Updated on

6 min read

Checking CPU information on Linux using lscpu and /proc/cpuinfo

When you need to know your CPU model, core count, frequency, or whether virtualization is enabled, Linux gives you that information directly from the command line without any additional tools.

This guide covers the two main ways to check CPU information: reading /proc/cpuinfo and using lscpu.

Get CPU Info from /proc/cpuinfo

The simplest way to determine what type of CPU you have is by reading the /proc/cpuinfo virtual file. This works on any Linux distribution without installing additional tools.

Use less or cat to display its contents:

Terminal
less /proc/cpuinfo

The file lists each logical CPU with an identifying number. For example, a 4-core processor with hyperthreading enabled typically shows entries from 0 to 7 (8 logical CPUs total). Here is an example of the output:

output
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 142
model name	: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
stepping	: 10
microcode	: 0x96
cpu MHz		: 700.120
cache size	: 6144 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge ...
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 3600.00
address sizes	: 39 bits physical, 48 bits virtual

...

Here is an explanation of the most useful fields:

  • processor - unique identifying number for each logical CPU, starting from 0
  • model name - full name of the processor including brand and speed
  • cpu MHz - current operating frequency of this logical CPU
  • cpu cores - number of physical cores in the processor chip
  • siblings - total logical CPUs in the same physical package (cores x threads per core)
  • physical id - identifier for the physical processor chip; systems with multiple sockets show different values here
  • flags - CPU feature flags indicating supported instruction sets and capabilities

To filter the output, use the grep command . To display only the processor model name:

Terminal
grep -m 1 'model name' /proc/cpuinfo
output
model name	: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz

To print the number of logical CPUs:

Terminal
grep -c 'model name' /proc/cpuinfo
output
8

Knowing the number of logical CPUs is useful when compiling software, as it tells you how many parallel jobs you can run. You can also get this number with the nproc command:

Terminal
nproc
output
8

To check whether your CPU supports hardware virtualization (Intel VT-x or AMD-V):

Terminal
grep -m 1 -E 'vmx|svm' /proc/cpuinfo

If the command returns output, the CPU supports virtualization. vmx indicates Intel VT-x and svm indicates AMD-V.

Check CPU Info with lscpu

lscpu is a command-line utility that displays a structured summary of CPU architecture. It is part of the util-linux package and is available on most Linux distributions.

Run lscpu to see the full summary:

Terminal
lscpu
output
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  2
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               142
Model name:          Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Stepping:            10
CPU MHz:             593.577
CPU max MHz:         3400.0000
CPU min MHz:         400.0000
BogoMIPS:            3600.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            6144K
NUMA node0 CPU(s):   0-7
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr ...

Unlike /proc/cpuinfo, lscpu presents an aggregated summary rather than a per-CPU listing, making it easier to read at a glance. Key fields include Thread(s) per core and Core(s) per socket which together show the physical vs. logical CPU relationship, and CPU max MHz and CPU min MHz which show the frequency range.

To view a detailed per-CPU table showing the core, socket, and thread layout, use the -e option:

Terminal
lscpu -e
output
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE    MAXMHZ   MINMHZ
  0    0      0    0 0:0:0:0          yes 3400.0000 400.0000
  1    0      0    0 0:0:0:0          yes 3400.0000 400.0000
  2    0      0    1 1:1:1:0          yes 3400.0000 400.0000
  3    0      0    1 1:1:1:0          yes 3400.0000 400.0000
  4    0      0    2 2:2:2:0          yes 3400.0000 400.0000
  5    0      0    2 2:2:2:0          yes 3400.0000 400.0000
  6    0      0    3 3:3:3:0          yes 3400.0000 400.0000
  7    0      0    3 3:3:3:0          yes 3400.0000 400.0000

This shows which logical CPUs share a physical core (hyperthreading pairs), which is useful when pinning processes to specific cores.

Quick Reference

CommandDescription
less /proc/cpuinfoView full CPU details per logical processor
grep -m 1 'model name' /proc/cpuinfoShow CPU model name
grep -c 'model name' /proc/cpuinfoCount logical CPUs
grep -m 1 -E 'vmx|svm' /proc/cpuinfoCheck virtualization support
nprocPrint number of available processing units
lscpuDisplay CPU architecture summary
lscpu -eShow per-CPU core and thread layout

Troubleshooting

lscpu: command not found
The lscpu utility is usually provided by the util-linux package. Install or update util-linux on your system, then run lscpu again.

No vmx or svm flag appears in /proc/cpuinfo
Your CPU may not support virtualization, or virtualization may be disabled in BIOS or UEFI. Check firmware settings and reboot after enabling virtualization.

FAQ

What is the difference between CPU cores and threads?
A physical core is an independent processing unit inside the CPU chip. Threads (also called logical CPUs) are the number of execution streams each core can handle simultaneously. With hyperthreading enabled, each physical core presents as two logical CPUs. The lscpu output shows both Core(s) per socket and Thread(s) per core.

How do I check if my CPU supports hardware virtualization?
Run grep -m 1 -E 'vmx|svm' /proc/cpuinfo. The presence of vmx indicates Intel VT-x support; svm indicates AMD-V. You can also check the Virtualization field in lscpu output. If the field shows VT-x or AMD-V, the CPU supports virtualization. You may still need to enable virtualization in BIOS or UEFI before virtual machines can use it.

How do I check CPU usage rather than CPU specs?
CPU usage is a runtime metric, not a hardware property. Use top or htop to view live CPU usage per process. For a quick snapshot, run top -bn1 | grep "Cpu(s)".

What is the difference between /proc/cpuinfo and lscpu?
/proc/cpuinfo shows raw per-logical-CPU entries as reported by the kernel. lscpu parses that same data and presents it in a more readable aggregated format. Both show the same underlying information; lscpu is generally easier to read for a quick overview.

Conclusion

The two main tools for checking CPU information on Linux are /proc/cpuinfo for raw per-CPU details and lscpu for a structured summary. For additional hardware inventory details, dmidecode -t processor (requires root) and lshw -class processor provide further information, though they are not installed by default on most distributions.

Linuxize Weekly Newsletter

A quick weekly roundup of new tutorials, news, and tips.

About the authors

Dejan Panovski

Dejan Panovski

Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page