The lscpu command is a simple tool in Linux that gives you detailed information about your CPU. It shows you everything from the number of cores to the supported instruction sets. This command is compatible with most Linux distributions and is an easy way to gather CPU details.

This guide will show you how to use lscpu to get all the information you need.

Installing lscpu

Most Linux distributions come with lscpu pre-installed. If you find it missing, you can easily install it. Here’s how:

For Debian/Ubuntu-based systems:

apt-get install util-linux

For Red Hat/CentOS-based systems:

yum install util-linux

Basic Usage of lscpu Command

Using lscpu is straightforward. Just open your terminal and type:

lscpu

This command will give you a comprehensive overview of your CPU. Here’s an example output:

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               GenuineIntel
  Model name:            11th Gen Intel(R) Core(TM) i3-1115G4 @ 3.00GHz
    CPU family:          6
    Model:               140
    Thread(s) per core:  2
    Core(s) per socket:  2
    Socket(s):           1
    Stepping:            1
    CPU max MHz:         4100.0000
    CPU min MHz:         400.0000
    BogoMIPS:            5990.40

Let’s break down what each part of the lscpu output means:

  • Architecture: The CPU is 64-bit, allowing it to handle 64-bit data and applications.
  • CPU op-mode(s): The CPU supports both 32-bit and 64-bit operations.
  • Address sizes: Can address up to 512 GB of physical memory and 256 TB of virtual memory.
  • Byte Order: Data is stored in Little Endian format, with the least significant byte first.
  • CPU(s): The system has 4 logical CPUs available.
  • On-line CPU(s) list: All 4 CPUs (0 to 3) are active and available for use.
  • Vendor ID: The CPU is manufactured by Intel.
  • Model name: It’s an 11th Gen Intel Core i3 processor running at 3.00 GHz.
  • CPU family: Identifies the CPU as part of Intel’s Family 6, which includes most modern processors.
  • Model: A specific identifier for this CPU within its family.
  • Thread(s) per core: Each core can handle 2 threads, thanks to Hyper-Threading.
  • Core(s) per socket: The CPU has 2 physical cores.
  • Socket(s): There is one physical CPU socket on the motherboard.
  • Stepping: Indicates the revision level of the CPU.
  • CPU max MHz: The CPU can boost up to 4.1 GHz under load.
  • CPU min MHz: The CPU can lower its speed to 400 MHz to save power.
  • BogoMIPS: A rough measure of CPU speed, calculated during system boot.

Filtering and Customizing lscpu Output

Sometimes you need specific information. You can filter lscpu output using tools like grep. For example, to show only the CPU model:

lscpu | grep 'Model name'

This command will display:

Model name:                         11th Gen Intel(R) Core(TM) i3-1115G4 @ 3.00GHz

If you want to see if your CPU supports virtualization:

lscpu | grep 'Virtualization'

Output:

Virtualization:                     VT-x

You can also format the output for better readability by using the -e flag:

lscpu -e

Output:

CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE    MAXMHZ   MINMHZ      MHZ
  0    0      0    0 0:0:0:0          yes 4100.0000 400.0000 1003.032
  1    0      0    1 1:1:1:0          yes 4100.0000 400.0000 1010.179
  2    0      0    0 0:0:0:0          yes 4100.0000 400.0000 1015.344
  3    0      0    1 1:1:1:0          yes 4100.0000 400.0000 1020.013

Conclusion

The lscpu command is a powerful tool that gives you a quick and detailed look into your CPU’s architecture. Whether you’re a system admin, developer, or just curious, understanding your CPU is crucial. Try using lscpu today to explore what your CPU has to offer on dedicated server hosting from Atlantic.Net!