lscpu

Linux · System · reference only

What it does

Shows CPU information: architecture, model, number of cores and threads, frequencies and caches.

Syntax

lscpu [opciones]

Options and parameters

  • -e

    Shows a table with one row per logical CPU.

  • -p

    Shows the information in a format easy for programs to process.

  • -J

    Shows the information as JSON.

  • -C

    Shows CPU cache information.

  • -a

    Includes both online and offline CPUs in the table.

  • -b

    Shows only the CPUs that are online.

Usage examples

  • lscpu

    Shows the full CPU summary.

  • lscpu -e

    Lists each logical CPU with its core and state.

  • lscpu -J

    Gets the same data as JSON to use in a script.

  • lscpu | grep -i model

    Filters the lines that mention the processor model.

Notes and common mistakes

  • It is part of util-linux and reads its information from /proc/cpuinfo and /sys.

Related commands