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:
- Open the terminal.
- Determine 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
- Obtain the CPU model 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
- 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.
- 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
- Get 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
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.