Fundamentals 11 min read

Master lscpu: Inspect CPU Architecture Details on Linux

This guide introduces the Linux lscpu command, explains its syntax and common options, provides example outputs in default, parsable and extended formats, clarifies each field's meaning, and offers practical usage notes for accurate CPU information retrieval.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master lscpu: Inspect CPU Architecture Details on Linux

What is lscpu?

lscpu is a Linux command that displays detailed CPU architecture information, including model, frequency, cores, sockets, cache sizes, virtualization support, and more.

Command syntax

lscpu [options]

Common options

-a, --all

: print both online and offline CPUs (default for -e) -b, --online: print only online CPUs (default for -p) -c, --offline: print offline CPUs -e, --extended[=<list>]: extended readable format -p, --parse[=<list>]: parsable format -s, --sysroot <dir>: use specified directory as sysroot -x, --hex: print hexadecimal masks instead of CPU lists -h, --help: display help and exit -V, --version: output version information and exit

Getting help

Run lscpu --help to see the full list of options.

Example: Display version

[root@jeven ~]# lscpu -V
lscpu from util-linux 2.23.2

Example: Basic output

[root@jeven ~]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                6
On-line CPU(s) list:   0-5
Thread(s) per core:    1
Core(s) per socket:    6
Socket(s):             1
NUMA node(s):          1
Vendor ID:             AuthenticAMD
CPU family:            23
Model:                 113
Model name:            AMD Ryzen 5 3600 6-Core Processor
Stepping:              0
CPU MHz:               3593.247
BogoMIPS:              7186.49
Virtualization:        AMD-V
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              512K
L3 cache:              32768K
NUMA node0 CPU(s):     0-5
Flags:                 fpu vme de pse tsc msr ... (list of flags)

Explanation of key fields

Architecture

: system architecture, e.g., x86_64. CPU op-mode(s): supported operating modes (32‑bit, 64‑bit). Byte Order: endianness, here Little Endian. CPU(s): total number of logical CPUs. On-line CPU(s) list: range of CPUs currently online. Thread(s) per core: threads per physical core. Core(s) per socket: cores per physical socket. Socket(s): number of physical sockets. NUMA node(s): number of NUMA nodes. Vendor ID: CPU vendor identifier. CPU family, Model, Model name: processor family and model details. CPU MHz: current clock speed. Virtualization: presence of virtualization extensions. Cache entries: sizes of L1d, L1i, L2, L3 caches. Flags: supported instruction set extensions.

Parsable format ( -p )

Using -p prints each CPU in a comma‑separated line: CPU,Core,Socket,Node,,L1d,L1i,L2,L3.

[root@jeven ~]# lscpu -p
# CPU,Core,Socket,Node,,L1d,L1i,L2,L3
0,0,0,0,,0,0,0,0
1,1,0,0,,1,1,1,0
2,2,0,0,,2,2,2,0
3,3,0,0,,3,3,3,0
4,4,0,0,,4,4,4,0
5,5,0,0,,5,5,5,0

Extended format ( -e )

Using -e prints a table with columns CPU, NODE, SOCKET, CORE, cache hierarchy and online status.

[root@jeven ~]# lscpu -e
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE
0   0    0      0    0:0:0:0       yes
1   0    0      1    1:1:1:0       yes
2   0    0      2    2:2:2:0       yes
3   0    0      3    3:3:3:0       yes
4   0    0      4    4:4:4:0       yes
5   0    0      5    5:5:5:0       yes

Usage notes

lscpu runs only on Linux; it is unavailable on other operating systems.

Root or sudo privileges are typically required to view all details.

Output may vary across distributions and hardware platforms.

Combine with grep, awk, etc., to filter specific fields.

Consult the manual page ( man lscpu) or lscpu --help for the complete option list.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxCPUHardwarecommand-lineSystem Informationlscpu
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.