Your IP-address is: 34.229.63.28 this Saturday 09, Dec 2023, 22:51:28

Published content

Get CPU Information On Linux

Get CPU Information On Linux.

An easy way to determine what type of CPU you have is by displaying the contents of the /proc/cpuinfo virtual file. Identifying the type of processor using the proc/cpuinfo file does not require you to install additional software. It works on all Linux distributions.

Open a terminal window and type:

less /proc/cpuinfo

Press Enter.

This command prints out each logical CPU ( Processor ) with an identifying number.

For example, if you have an INTEL™8 core processor you will see a list of all cores starting from 0 to 7.

==============================================================

Most interesting is:

  • Processor
  • Vendor_ID
  • Model Name
  • Bugs
  • Flags ( Features )

==============================================================

To filter the output:

grep -m 1 'model name' /proc/cpuinfo

Press Enter.

The result:

model name    : Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz

To print out how many cores your CPU has:

grep -c 'model name' /proc/cpuinfo

The result:

8

Knowing the number of CPUs can be handy when you need to compile software from source and you want to know how many parallel processes can be concurrently executed or if you are running another system in Virtualbox and want to assign more than one core.

You can use another command to get the same info:

nproc

Press Enter.

For less info, use the following command:

lscpu

Press Enter, lscpu will not show you a list of all logical CPUs. For other details about CPU and your system, see top or htop.

Top