The technology of CPU is getting more and more massive. Nearly all computers now use at least a dual-core CPU. By the way, how do you can check the number of cores of a CPU in Linux?.
There are several tools you can use to check the number of cores of a CPU in Linux, but the most common one is lscpu. This tool doesn’t require a root access to run and it is already installed on most Linux distro. If you are new to Linux, don’t be scary. This tool is extremely to use.
In Linux you can basically check the number of cores of a CPU by displaying the contents of the cpuinfo file which is located under the “/proc” directory of your system. It’s just, the contents is less simple, especially if your CPU consists of more than two cores. lscpu has made it simpler by gathering the CPU information from that file into a much more simpler outputs.
To use the lscpu command, simply type
lscpuon the terminal and you will find the following outputs.
To check the number of cores, you can see at the “CPU(s)” column. On the screenshot above, you can see that the CPU of the computer I use consists of two cores (dual-core). This column (and also other columns of the table) will display different value depending on the CPU you use.
In addition to lscpu, you can also use inxi to check the number of CPU cores in Linux. However, this tool is not installed by default in most Linux distros. Inxi isn’t also specifically designed to check the CPU info like lscpu.