Skip to content

lscpu Linux Command Guide

The lscpu command in Linux provides detailed information about the CPU architecture, processing units, sockets, cores per socket, threads per core, and more. It helps users understand the configuration of their CPU and how it is utilized by the system. By running lscpu, you can quickly access essential details about your CPU, such as its model name, vendor, CPU family, cache sizes, and processor flags. This command is useful for system administrators, developers, and users who need to optimize system performance, troubleshoot issues, or gather information about the CPU for various purposes.

Terminal window
lscpu [options]
OptionDescription
-aDisplay all information
-pShow all available information
-eShow extended information
-sShow short output
-xShow additional details
-yShow information in YAML format
-cShow information in CSV format
ParameterDescription
NoneIt does not have any specific parameter.
Terminal window
lscpu

Displays detailed information about the CPU.

Terminal window
lscpu | grep Architecture

Displays only the architecture information of the CPU.

Terminal window
lscpu | grep "Core(s) per socket"

Displays the number of CPU cores per socket.

Terminal window
lscpu | grep "Thread(s) per core"

Displays the number of threads per CPU core.

Terminal window
lscpu | grep "CPU MHz"

Displays the CPU clock speed in MHz.

Terminal window
lscpu | grep "Socket(s)"

Displays the number of CPU sockets.

Terminal window
lscpu | grep "Vendor ID"

Displays the CPU vendor information.

How do I display CPU architecture information using lscpu?

Section titled “How do I display CPU architecture information using lscpu?”

To display CPU architecture information using lscpu, run the following command:

Terminal window
lscpu

How to show just the CPU model name with lscpu?

Section titled “How to show just the CPU model name with lscpu?”

To show just the CPU model name with lscpu, use the following command:

Terminal window
lscpu | grep "Model name"

Can lscpu show the number of physical CPU sockets?

Section titled “Can lscpu show the number of physical CPU sockets?”

Yes, to display the number of physical CPU sockets using lscpu, use the command:

Terminal window
lscpu | grep "Socket(s)"

How to get information about CPU cores and threads with lscpu?

Section titled “How to get information about CPU cores and threads with lscpu?”

To get information about CPU cores and threads with lscpu, execute the command:

Terminal window
lscpu | grep -E "Core(s) per socket|Thread(s) per core"

What is the command to display CPU cache information using lscpu?

Section titled “What is the command to display CPU cache information using lscpu?”

To display CPU cache information using lscpu, use the following command:

Terminal window
lscpu | grep -E "L1d|L1i|L2|L3"

Can lscpu provide details about CPU flags?

Section titled “Can lscpu provide details about CPU flags?”

Yes, you can use lscpu to get details about CPU flags by running the command:

Terminal window
lscpu | grep "Flags"
  • Determine the number of CPUs on the system
  • View information about the CPU architecture
  • Display CPU vendor information
  • Show CPU family, model, and stepping
  • Check CPU frequency and max/min frequencies
  • View CPU cache information
  • Display NUMA (Non-Uniform Memory Access) information
  • Show flags indicating CPU features
  • Determine the endianness of the CPU
  • Check the number of threads per core and cores per socket