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:
- Open the terminal.
- 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
- Check the CPU architecture.
$ lscpu | grep ^Architecture Architecture: x86_64
- 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.
- Find the CPU maker or manufacturer.
$ sudo dmidecode --type processor | grep Manufacturer: Manufacturer: Intel(R) Corporation
- Find the CPU model name and version.
$ lscpu | grep ^Model\ name Model name: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
- Determine the number of CPU cores.
$ lscpu | grep ^CPU\(s\) CPU(s): 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.
- 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
- Check the current CPU speed.
$ lscpu | grep ^CPU\ MHz CPU MHz: 2304.000
- 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.
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Comment anonymously. Login not required.