Linux stores CPU information in several system files, including /proc/cpuinfo and /sys (or sysfs). These files contain essential details about your system's CPU, such as architecture, model, and manufacturer. Accessing this information helps in understanding the processing power and capabilities of your Linux machine.

To simplify the process of gathering CPU details, Linux provides command-line tools like lscpu, dmidecode, and hwinfo. These tools retrieve and display information about the CPU in a readable format. While lscpu and dmidecode are usually pre-installed, you may need to install hwinfo on some distributions like Ubuntu.

The steps below outline how to check your CPU information on a Linux system. These steps help you identify key details, such as the number of cores, architecture, and possible vulnerabilities.

Steps to check CPU information in Linux:

  1. Open the terminal.
  2. Display basic CPU information.
    $ lscpu
    Architecture:                    x86_64
    CPU op-mode(s):                  32-bit, 64-bit
    Model name:                      Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    CPU(s):                          8
    Thread(s) per core:              2
  3. Check the CPU architecture.
    $ lscpu | grep ^Architecture
    Architecture:                    x86_64
  4. Identify the CPU op-mode.
    $ lscpu | grep ^CPU\ op-mode
    CPU op-mode(s):                  64-bit

    64 bit processors can run both 64 and 32 bit operating systems. Run uname -p to see the if your Linux system is running the 64 or 32 bit version.

  5. Find the CPU maker or manufacturer.
    $ sudo dmidecode --type processor | grep Manufacturer:
      Manufacturer: Intel(R) Corporation
  6. Find the CPU model name and version.
    $ lscpu | grep ^Model\ name
    Model name:                      Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  7. Determine the number of CPU cores.
    $ lscpu | grep ^CPU\(s\)
    CPU(s):                          8
  8. Check the number of threads per core.
    $ lscpu | grep ^Thread
    Thread(s) per core:              2

    Multiply the number of cores by the number of threads per core to get the total number of threads.

  9. Identify known CPU vulnerabilities.
    Vulnerabilities:       
      Itlb multihit:       Not affected
      L1tf:                Not affected
      Mds:                 Not affected
      Meltdown:            Not affected
      Mmio stale data:     Not affected
      Retbleed:            Not affected
      Spec store bypass:   Mitigation; Speculative Store Bypass disabled via prctl
      Spectre v1:          Mitigation; __user pointer sanitization
      Spectre v2:          Not affected
      Srbds:               Not affected
      Tsx async abort:     Not affected
  10. Check the current CPU speed.
    $ lscpu | grep ^CPU\ MHz
    CPU MHz:                         2304.000
  11. Retrieve the CPU ID or serial number.
    $ sudo dmidecode --type processor | grep -m1 ID\: 
    	ID: ED 06 09 00 FF FC 8B 1F

    The CPU ID is unique to each processor and can be used for identification purposes.

Discuss the article:

Comment anonymously. Login not required.