lscpu(1)
Display information about the CPU architecture and details from /proc/cpuinfo.
Synopsis
lscpu [OPTION]...Description
lscpu gathers CPU architecture information from /proc/cpuinfo, /proc/meminfo, /proc/stat and other system files. It displays the number of CPUs, cores, threads, cache sizes, CPU flags, and other hardware details in a human-readable format.
Output can be formatted as key-value pairs, JSON, or CSV for easy parsing by scripts. This tool is useful for understanding your system's CPU capabilities, checking core counts for parallel processing, and verifying CPU flags like virtualization support.
Common options
| Flag | What it does |
|---|---|
-a, --all | include lines with empty DATA fields |
-b, --online | print only online CPUs |
-e, --extended | print extended output with additional columns |
-J, --json | output in JSON format |
-p, --parse=LIST | output only specified columns (comma-separated) |
-s, --sysroot=DIR | use alternative system root directory |
-x, --hex | print hexadecimal masks instead of CPU lists |
-y, --physical | print physical IDs instead of logical CPU numbers |
-C, --caches | show cache information |
-h, --help | display help message and exit |
Examples
Display all CPU architecture information in default key-value format
lscpuShow total number of logical CPUs available
lscpu | grep 'CPU(s):'Output CPU information in JSON format for programmatic parsing
lscpu -JDisplay only CPU, core, and socket information in columns
lscpu -p=CPU,CORE,SOCKETShow the CPU model and brand name
lscpu | grep 'Model name'Display detailed cache hierarchy (L1, L2, L3 sizes and counts)
lscpu -CCheck if CPU supports virtualization (VMX for Intel, SVM for AMD)
lscpu | grep -i 'vmx\|svm'Print in parseable format with architecture details for scripting
lscpu -p