Table of Contents
This guide is about Guide: Check your CPU in a Linux system. So read this free guide, Guide: Check your CPU in a Linux system step by step. If you have query related to same article you may contact us.
Guide: Check your CPU in a Linux system – Guide
The number of CPUs or cores can be called up on Linux from the command line. The /proc/cpuinfo file stores CPU and system architecture dependent elements for each supported architecture. You can view /proc/cpuinfo using the cat command or the grep/egrep command. This page shows how to use the /proc/cpuinfo file and the lscpu command to see the number of processors on Linux.
Get CPU information using the cat command
You can simply view your system’s CPU information by viewing the contents of the /proc/cpuinfo file with the help of the cat command as follows:
$cat / proc / cpuinfo
To get a little more specific, you can employ the grep command – a CLI tool to search plain text data for lines that match a regular expression. This can help you to produce just the vendor name, the model name, the number of processors, the number of cores, etc:
lscpu Command – Show CPU architecture information
The lscpu command prints CPU architecture information from sysfs and /proc/cpuinfo as shown below:
$lscpu
cpuid Command – Shows CPU x86
The cpuid command dumps complete information about the CPU(s) collected from the CPUID instruction and also discovers the exact model of x86 CPU(s) from this information. Make sure you install it before running it. Once installed, run cpuid to collect information about the x86 CPU.
$cpuid
dmidecode Command – Show Linux Hardware Information
dmidecode is a tool to retrieve hardware information from any Linux system. It dumps the contents of a computer’s DMI table (also known as SMBIOS) into a readable format for easy recovery. The SMBIOS specification defines several types of DMI, for CPU, use “processor” as follows:
$ sudo dmidecode – type processor
Inxi Tool – Shows Linux System Information
Inxi is a powerful command line system information script intended for both console and IRC (Internet Relay Chat). You can use it to retrieve hardware information instantly. To display complete CPU information, including CPU clock speed and maximum CPU speed (if available), use the -C flag as follows:
$inxi -C
lshw Tool – List Hardware Configuration
lshw is a minimal tool for gathering detailed information about a computer’s hardware configuration. You can use the -C option to select the hardware class, CPU in this case:
$ sudo lshw -C CPU
hardinfo – Show hardware information in GTK + window
hardinfo displays hardware information in a GTK+ window, you can install it as follows. After installing it, type:
$hardinfo
It also allows you to generate a report of system hardware information by clicking “Generate Report” button. In the interface below, click “Generate” to proceed. Note that you can choose the category of hardware information to be generated.
After generating the report in html format, you can preview it in a web browser.
hwinfo – Show current hardware information
hwinfo is used to extract information about the hardware present on a Linux system. To display information about your CPU, use –cpu
$hwinfo -cpu
nproc – Print number of processing units
The nproc command is used to show the number of the processing unit present on your computer:
$ nprocFor additional information and usage options, read the man pages for these commands like this:
$man commandname
Final note
I hope you like the guide Guide: Check your CPU in a Linux system. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.