Linux stores information about CPU architectures of your system in various places. Some information about the CPU is stored in the /proc/cpuinfo file, while others are scattered in the /sys filesystem or sysfs. You can view your computer system's CPU details by navigating these files.

Some Linux tools that gather CPU information and display them in more readable formats are lscpu, dmidecode, and hwinfo. All are command-line tools that you can use to manually view CPU information or to automate via scripts. lscpu and dmidecode are installed by default in most Linux systems, while hwinfo will need to be installed in systems such as Ubuntu.

CPU information you can gather from these tools are the number of CPUs or cores, name and model, architecture type, and much more.

Steps to get CPU details in Linux:

  1. Launch terminal.
  2. Check the architecture of the CPU.
    $ lscpu | grep ^Architecture
    Architecture:                    x86_64
  3. Get 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.

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

    The total number of thread of the CPU is to multiply the number of cores and the thread per core count.

  8. Check if the CPU is vulnerable to CPU-specific 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
  9. Get current CPU speed.
    $ lscpu | grep ^CPU\ MHz
    CPU MHz:                         2304.000
  10. Get the ID or serial number of the CPU.
    $ sudo dmidecode --type processor | grep -m1 ID\: 
    	ID: ED 06 09 00 FF FC 8B 1F
Discuss the article:

Comment anonymously. Login not required.