Linux stores CPU architecture information for your system in various locations. The /proc/cpuinfo file contains some CPU data, while other details can be found in the /sys filesystem or sysfs. To view your computer's CPU information, you can navigate through these files.

Several Linux tools, such as lscpu, dmidecode, and hwinfo, gather CPU information and present it in a more understandable format. These command-line tools can be used to view CPU information manually or through automation with scripts. lscpu and dmidecode come pre-installed on most Linux systems, while hwinfo may need to be installed on systems like Ubuntu.

These tools provide CPU information such as the number of CPUs or cores, name and model, architecture type, and more.

Steps to get CPU details in Linux:

  1. Open the terminal.
  2. Determine the CPU architecture.
    $ lscpu | grep ^Architecture
    Architecture:                    x86_64
  3. 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.

  4. Find the CPU maker or manufacturer.
    $ sudo dmidecode --type processor | grep Manufacturer:
      Manufacturer: Intel(R) Corporation
  5. Obtain the CPU model and version.
    $ lscpu | grep ^Model\ name
    Model name:                      Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  6. Determine the number of CPU cores.
    $ lscpu | grep ^CPU\(s\)
    CPU(s):                          8
  7. Identify the number of threads 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 for CPU-specific 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
  9. Get the current CPU speed.
    $ lscpu | grep ^CPU\ MHz
    CPU MHz:                         2304.000
  10. Retrieve the CPU ID or serial number.
    $ sudo dmidecode --type processor | grep -m1 ID\: 
    	ID: ED 06 09 00 FF FC 8B 1F
Discuss the article:

Comment anonymously. Login not required.