How to check your CPU frequency on Linux?

Check Your CPU Frequency On Linux

A CPU or Central Processing unit of any computer is responsible for performing all the tasks on your computer. The power of any CPU can be determined in terms of its CPU frequency or clock speed or clock rate. The higher the value, the faster your CPU can process a number of instructions per second. Usually, it is measured in MHz (Megahertz) or GHz (Gigahertz).

There might be a number of reasons why you should know the frequency of your CPU, a number of programs or games only run on higher-end hardware, or you might want to submit a bug, and therefore you need to describe your exact hardware to the developer.

There is of course more than one method through which you can figure out the specifications of your CPU, and we will discuss all of them one by one, you can figure out which one is the easiest method for you!

Also Read – Check your CPU and GPU Temperatures on Linux.

Check your CPU frequency using the Dmseg command

The Dmseg command is usually used to show the messages from the ring buffer of the Linux Kernel. But when used along with the ‘Grep’ command, you can filter out the CPU frequency and other CPU-related information. Type the following command in your Terminal using root privileges :

sudo dmesg | grep MHz
Finding CPU Frequency Using Dmseg Command
Finding CPU Frequency Using Dmseg Command

As you can see, my processor’s clock rate is 3293.906 MHz.

Fetch it from the ‘/proc/cpuinfo’ file

The ‘cpuinfo’ file in the /proc directory stores all the information related to your CPU, so, using the combination of ‘cat’ and ‘grep’ command, you can figure it out very easily. Just type the following command in your Terminal:

cat /proc/cpuinfo | grep MHz
Fetch The Frequency Of Individual Cores Of Your CPU
Fetch The Frequency Of Individual Cores Of Your CPU

Note that if you have a multicore CPU, this command will show you the speed of each individual core, which can also be helpful if you are trying to determine the number of cores of your CPU.

Using the lscpu command

lscpu command is used to determine the CPU architecture in the Terminal. It already comes pre-installed on your distribution, as it is part of the util-Linux package. Just type the following command in your Terminal :

sudo lscpu
Finding The Frequency Of CPU Using The Lscpu Command
Finding the Frequency of CPU using The lscpu Command

As you can see, my max CPU frequency comes out to be 4280 MHz.

i7z command for Intel CPUs

If you have an Intel processor, then you should check out this useful utility specifically built for i3, i5 and i7 CPUs. Make sure to install it using your distribution’s package manager and then type the following command to determine your CPU frequency :

sudo i7z

I cannot show you any screenshots here as I’m using an AMD machine but the output is really easy to figure out.

Using the hwinfo command :

‘hwinfo’ command can be used to give out any information related to the hardware of your PC. And if you specifically pass the –cpu argument, the output will look something like this :

sudo hwinfo --cpu
Check Your CPU Frequency Using Hwinfo
Check Your CPU Frequency Using Hwinfo

This command shows us that my CPU clock speed is 3266 MHz.

Using the inxi script

In my opinion, inxi is the most beautiful of all the above-mentioned tools, it displays all the information in a descriptive, yet easy to read manner. You can install it using your package manager (such as apt, pacman, dnf) and then run it like this :

sudo inxi -C
Using The Inxi Script To Display The CPU Frequency
Using The Inxi Script To Display The CPU Frequency

Summary

All the above-mentioned tools are wonderful to determine the CPU frequency, however you should figure out which tool’s output interface you like the most and use it regularly. Well that’s about it, do let me know in the comments if you have any doubt regarding any of the tools mentioned above.

References