LinuxCommandLibrary

lscpu

TLDR

Display information about all CPUs

$ lscpu
copy
Display information in a table format
$ lscpu -e
copy
Display only information about online CPUs
$ lscpu -e -b
copy
Display only information about offline CPUs
$ lscpu -e -c
copy
Display details about CPU caches
$ lscpu -C
copy
Display information in JSON format
$ lscpu -J
copy

SYNOPSIS

lscpu [-e] [-b] [-c] [-C] [-J] [-p]

DESCRIPTION

lscpu displays information about the CPU architecture gathered from /proc/cpuinfo and sysfs. It shows CPU model, cores, threads, caches, NUMA nodes, and CPU flags.

PARAMETERS

-e, --extended

Display information in extended (table) format
-b, --online
Limit display to online CPUs (with -e)
-c, --offline
Limit display to offline CPUs (with -e)
-C, --caches
Display details about CPU caches
-J, --json
Output in JSON format
-p, --parse
Optimize output for parsing
-x, --hex
Use hexadecimal masks for CPU sets
-y, --physical
Print physical IDs instead of logical
-s, --sysroot dir
Use specified directory as system root

CAVEATS

Information varies by architecture and kernel version. Some fields may not be available on all systems.

HISTORY

Part of util-linux package. Provides a convenient way to view CPU information that would otherwise require parsing /proc/cpuinfo.

SEE ALSO

cpuinfo(5), dmidecode(8), nproc(1)

Copied to clipboard