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

By 

Updated on

11 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 explains how to read /proc/cpuinfo and use lscpu, along with specialized tools for firmware and hardware inventory details.

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, but the available fields vary by processor architecture. The examples below use x86 output.

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

This command counts the logical CPUs listed in /proc/cpuinfo on an x86 system. The model name field may be absent on ARM and other architectures, so use lscpu for a portable system-wide count.

When compiling software, use nproc to see how many processing units are available to the current process:

Terminal
nproc
output
8

The result can be lower than the system-wide count when CPU affinity, container limits, cgroups, or OpenMP environment variables restrict the process.

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.

The cpu MHz field, when present, is a live reading rather than a fixed specification, because modern processors scale their clock with load. To watch it move, run the following in one terminal while a CPU-bound job runs in another:

Terminal
watch -n 1 "grep 'cpu MHz' /proc/cpuinfo"

The values climb as the governor raises the clock and settle back once the load drops. Running lscpu -e=CPU,MHZ prints the same live figures in a more compact table.

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
  Address sizes:          39 bits physical, 48 bits virtual
  Byte Order:             Little Endian
CPU(s):                   8
  On-line CPU(s) list:    0-7
Vendor ID:                GenuineIntel
  Model name:             Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
    CPU family:           6
    Model:                142
    Thread(s) per core:   2
    Core(s) per socket:   4
    Socket(s):            1
    Stepping:             10
    CPU(s) scaling MHz:   21%
    CPU max MHz:          3400.0000
    CPU min MHz:          400.0000
    BogoMIPS:             3600.00
    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr ...
Virtualization features:
  Virtualization:         VT-x
Caches (sum of all):
  L1d:                    128 KiB (4 instances)
  L1i:                    128 KiB (4 instances)
  L2:                     1 MiB (4 instances)
  L3:                     6 MiB (1 instance)
NUMA:
  NUMA node(s):           1
  NUMA node0 CPU(s):      0-7
Vulnerabilities:
  Meltdown:               Mitigation; PTI
  Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:             Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling

Unlike /proc/cpuinfo, lscpu presents an aggregated summary rather than a per-CPU listing, making it easier to read at a glance. Version 2.39 of util-linux introduced the hierarchical format shown above. Current releases use it automatically when output goes directly to a terminal, while pipes and redirects receive a flat Field: value list for compatibility. Use lscpu --hierarchic=always when a pipe needs to preserve the subsections. Releases earlier than 2.39 print the flat format.

Thread(s) per core and Core(s) per socket together show the physical vs. logical CPU relationship: four cores running two threads each produce the eight logical CPUs reported at the top. CPU max MHz and CPU min MHz bound the frequency range, and CPU(s) scaling MHz reports the current clock as a percentage of that maximum.

The Caches (sum of all) section totals each level across the whole chip rather than per core, so L2: 1 MiB (4 instances) means four cores with 256 KiB each. The Vulnerabilities section, trimmed above for length, lists the CPU side-channel issues the kernel knows about and the mitigation it applied to each.

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      MHZ
  0    0      0    0 0:0:0:0          yes 3400.0000 400.0000 700.1200
  1    0      0    0 0:0:0:0          yes 3400.0000 400.0000 700.0730
  2    0      0    1 1:1:1:0          yes 3400.0000 400.0000 700.0000
  3    0      0    1 1:1:1:0          yes 3400.0000 400.0000 700.5170
  4    0      0    2 2:2:2:0          yes 3400.0000 400.0000 700.0000
  5    0      0    2 2:2:2:0          yes 3400.0000 400.0000 700.2440
  6    0      0    3 3:3:3:0          yes 3400.0000 400.0000 700.0000
  7    0      0    3 3:3:3:0          yes 3400.0000 400.0000 700.3810

This shows which logical CPUs share a physical core, which is useful when pinning processes to specific cores. Compare the SOCKET and CORE columns: rows carrying the same values in both columns are sibling threads, so CPUs 0 and 1 above share one physical core. The trailing MHZ column holds the live clock of each thread and appears only when the kernel exposes frequency data.

Check CPU Architecture

Sometimes you do not need the full picture, only whether the machine is 64-bit x86 or ARM, before downloading a binary or choosing a container image. The uname command prints the architecture with -m:

Terminal
uname -m
output
x86_64

x86_64 (also written amd64) is a 64-bit Intel or AMD processor, aarch64 (also written arm64) is 64-bit ARM, and i686 is a 32-bit x86 system. The arch command is a shorter alias that prints the same value.

lscpu reports the architecture along with the modes the CPU can run:

Terminal
lscpu | grep -E 'Architecture|op-mode'
output
Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit

The CPU op-mode(s) line matters when the two disagree. A CPU that lists both 32-bit and 64-bit is 64-bit capable even if uname -m returns i686, which happens on an old 32-bit installation that was never reinstalled on newer hardware.

Other Tools for CPU Details

/proc/cpuinfo and lscpu describe the CPU and its topology using kernel data. Firmware DMI or SMBIOS tables may supply additional values, such as the socket designation printed on the board. The tools below read or combine these sources, and their availability varies by distribution.

On Ubuntu, Debian, and Derivatives:

Terminal
sudo apt install dmidecode lshw inxi

On Fedora, RHEL, and Derivatives, install dmidecode and lshw with:

Terminal
sudo dnf install dmidecode lshw

Fedora also provides inxi in its standard repositories:

Terminal
sudo dnf install inxi

On RHEL 8 or 9 and their derivatives, inxi is available through Extra Packages for Enterprise Linux (EPEL) rather than the standard repositories. After enabling the matching EPEL repository, install it with sudo dnf install inxi.

dmidecode decodes the firmware’s DMI or SMBIOS tables. It reads them from sysfs first and falls back to /dev/mem if sysfs access fails. The output can include the manufacturer’s socket designation and the speeds advertised by the firmware. It normally needs root:

Terminal
sudo dmidecode -t processor
output
Handle 0x0004, DMI type 4, 48 bytes
Processor Information
	Socket Designation: U3E1
	Type: Central Processor
	Family: Core i5
	Manufacturer: Intel(R) Corporation
	Version: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
	Voltage: 1.0 V
	Max Speed: 3400 MHz
	Current Speed: 1600 MHz
	Core Count: 4
	Thread Count: 8

Socket Designation names the physical socket on the board, which tells you which chip to pull when a multi-socket server reports a fault on one CPU. On a virtual machine these values are whatever the hypervisor chose to present, so treat them as advisory. Note that Current Speed comes from the firmware and is usually the rated base clock, not the live frequency; /proc/cpuinfo remains the place to read that.

lshw combines information from sources such as sysfs and SMBIOS into a hardware inventory, so you can inspect the processor without remembering DMI type numbers:

Terminal
sudo lshw -class processor

For a compact summary that fits on one screen, inxi is hard to beat:

Terminal
inxi -C
output
CPU:
  Info: quad core model: Intel Core i5-8250U bits: 64 type: MT MCP cache: L2: 1 MiB
  Speed (MHz): avg: 700 min/max: 400/3400 cores: 1: 700 2: 700 3: 700 4: 700
    5: 700 6: 700 7: 700 8: 700

Adding more x flags expands the detail, so inxi -Cxxx also prints the stepping, the microcode revision, and the CPU family. To inventory the rest of the machine rather than the processor alone, see our guide on listing hardware in Linux .

Quick Reference

CommandDescription
less /proc/cpuinfoView full CPU details per logical processor
grep -m 1 'model name' /proc/cpuinfoShow the x86 CPU model name
grep -c 'model name' /proc/cpuinfoCount x86 logical CPUs listed by the kernel
grep -m 1 -E 'vmx|svm' /proc/cpuinfoCheck Intel or AMD virtualization flags
nprocCount processing units available to the current process
watch -n 1 "grep 'cpu MHz' /proc/cpuinfo"Watch the live clock when the field is available
lscpuDisplay CPU architecture summary
lscpu -eShow per-CPU core and thread layout
uname -mPrint the CPU architecture
sudo dmidecode -t processorRead socket and firmware CPU details
sudo lshw -class processorShow the processor entry from the hardware inventory
inxi -CPrint a compact CPU summary

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.

dmidecode prints nothing or reports a permission error
dmidecode first reads the firmware tables from sysfs and falls back to /dev/mem if necessary. Access to either source normally requires root, so prefix the command with sudo. Inside most containers and on some virtual machines the DMI tables are not exposed at all, and the command may report no processor entries even as root. Fall back to lscpu there.

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 usage per process, or mpstat -P ALL 1 5 for per-core samples. For a quick snapshot, run top -bn1 | grep "Cpu(s)". Our guide on checking CPU usage in Linux covers each of those tools in detail.

How do I count physical cores rather than logical CPUs?
Multiply Core(s) per socket by Socket(s) in the lscpu output on systems with uniform sockets. For a direct count across multiple sockets, run lscpu -p=SOCKET,CORE | grep -v '^#' | sort -u | wc -l. The cpu cores field in /proc/cpuinfo is x86-specific and reports the count for one physical package, not the whole system. The nproc command reports logical CPUs available to the current process, which may be lower than the system total.

What is the difference between /proc/cpuinfo and lscpu?
/proc/cpuinfo shows architecture-specific CPU entries reported by the kernel. lscpu combines that file with sysfs and any applicable architecture-specific libraries, then presents the result as an aggregated summary or per-CPU table. This allows lscpu to show topology and cache relationships more clearly.

Conclusion

/proc/cpuinfo provides raw per-CPU records, while lscpu gives a clearer summary of architecture, topology, cache, and frequency. Use dmidecode, lshw, or inxi when you need firmware details or a broader inventory, then turn to checking CPU usage in Linux to see how the processor behaves under load.

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 1000+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page