lscpu

lscpu reports information about the CPU, such as its architecture, vendor identification, virtualization features, cache (L1/L2/L3), and CPU vulnerabilities.

Installation

When lscpu is not installed by default, it can be added to the system using the relevant software package.

Package information for lscpu

Operating systemPackage nameInstallation
AlmaLinuxutil-linux
dnf install util-linux
Arch Linuxutil-linux
pacman -S util-linux
Debianutil-linux
apt install util-linux
Fedorautil-linux
dnf install util-linux
Red Hat Enterprise Linuxutil-linux
dnf install util-linux
Rocky Linuxutil-linux
dnf install util-linux
Ubuntuutil-linux
apt install util-linux

Your Linux distribution using a different package? Share your feedback.

Usage

Available options

Short optionLong optionDescription
-a--allShow online and offline CPUs when used together with -e or -p
-B--bytesUse bytes instead of human-readable format
-bonlineOnly online CPUs, to be used with -e or -p
-C--caches[=list]CPU cache information. List is optional, and can be used for column selection
-c--offlineOnly offline CPUs, to be used with -e or -p
-h--helpShow help
-J--jsonJSON output
-p--parse[=list]Tune output for easier parsing. List is optional, and can be used for column selection
-s--sysroot directoryInspect another Linux instance instead of the active system
-x--hexUse hexadecimal masks
-y--physicalShow physical IDs, which are platform-specific and provided by the kernel.
-v--versionShow lscpu version
--output-allShow all available column, to be combined with --extended (-e), --parse (-p), or --caches (-C)

Missing an option in this overview? Share your feedback.

Relevant articles using the lscpu command

The following articles include an example on how to use lscpu and might be worth further exploring.