Any way to check the clock speed of my processor?

Is there any way to check at which clock speed my processor is running?

I have already tried cat /proc/cpuinfo but the clock speed I’m running isn’t showing. I know Ubuntu 12.04 (Precise Pangolin) requires 700 MHz and VGA, but will an AMD Mobile Sempron work?

Asked By: user1610406

||

From the command line type lscpu. The information will be at CPU MHz:

~$ lscpu | grep MHz
CPU MHz:               804.901
CPU max MHz:           3200.0000
CPU min MHz:           800.0000
Answered By: Kevin Bowen

There are a couple of ways:

  1. lscpu or more precise lscpu | grep "MHz".
    This will give you the general MHz for the CPU.

     $ lscpu | grep "MHz".
     CPU MHz:               1600.000
    
  2. cat /proc/cpuinfo or more precise cat /proc/cpuinfo | grep "MHz".
    This will give you the individual MHz for each CPU Core. So if you have an Core 2 Duo, AMD Bulldozer, Core i7, etc.. it will show the MHz for each core.

    $ cat /proc/cpuinfo | grep "MHz"
    cpu MHz     : 1600.000
    cpu MHz     : 1600.000
    cpu MHz     : 1600.000
    cpu MHz     : 1600.000
    cpu MHz     : 1600.000
    cpu MHz     : 1600.000
    cpu MHz     : 1600.000
    cpu MHz     : 3400.000
    
  3. lshw -c cpu or more precise version: lshw -c cpu | grep capacity
    Will give you the general MHz. Same as lscpu.

    $ lshw -c cpu | grep capacity
    WARNING: you should run this program as super-user.
           capacity: 1600MHz
    WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
    
  4. sudo dmidecode -t processor or more precise: sudo dmidecode -t processor | grep "Speed" Will not only give you a MHz in use but also the Maximum you can push / overclock your CPU to.

     $ sudo dmidecode -t processor | grep Speed
     [sudo] password for cyrex: 
         Max Speed: 4000 MHz
         Current Speed: 2666 MHz
    

Out of all of this, lshw and dmidecode provide the best information out of your CPU.

You can also target the current MHz detected by the kernel by querying the log files:

cat /var/log/dmesg | grep "MHz processor" – For the current detected MHz speed

cat /var/log/kern.log | grep "MHz processor" – For the current and past detected MHz speeds. Will not work in some cases, that is why I posted the dmesg one first.

And that’s all I can remember from the top of my head. I am fairly certain there are other ways, just don’t remember right now. Of course, talking about terminal ways.

Note: All the commands above will also give you the CURRENT cpu Hertz, meaning, if you expect to see the same one on lscpu and when doing the cat /proc/cpuinfo it will be near impossible. you CAN compare the maximum because that should show the same for any of the ways you can analyze the CPU, but the current will always be literally "the current CPU hertz" at the moment you execute it. Lastly do note that dmidecode reads information from the ACPI tables which is not always the same as the real time ones done by the other tools.

Answered By: Luis Alvarado

For the current CPU speed one can dynamically watch this change in real time using:

sudo watch -n 1  cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq

To see the maximum CPU speed, use:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq 
Answered By: Colin Ian King

In a terminal, enter:

cat /proc/cpuinfo | grep name

It should display the exact model of your CPU.

This Wikipedia page on the Sempron will give you detailed specifications.

Answered By: Gord Campbell

indicator-cpufreq-selector is a nice little indicator tool which shows your current CPU frequency. You can even select the desired CPU frequency.

enter image description here

However, the last update for this tool was on 2021-05-28.

Answered By: Stephan Schielke

I would just like to add i7z to this list. Contrary to the other options, this works better for CPUs in the i7, i5 and i3 series that have TurboBoost.

Answered By: jmiserez

I wanted to share this as a comment, but dont have many reputations on askubuntu, People who want to use indicator-cpufreq do not need to reboot the computer. Resetting the current X session is enough to display the icon.

sudo apt-get install indicator-cpufreq   
DISPLAY=:0 compiz --replace

You can validate the Performance and Powersave option by seeing the current frequency by

watch -d "cat /proc/cpuinfo | grep -i Mhz"

As soon as you click on a lower frequency / Powersave, the powermanagement of the CPU kicks in, thereby reducing the clock cycle.

Answered By: infoclogged
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
Answered By: Vadimo

Sample output of cat /proc/cpuinfo

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 774.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 1600.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 800.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 1
cpu cores   : 2
apicid      : 2
initial apicid  : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 774.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 1
cpu cores   : 2
apicid      : 3
initial apicid  : 3
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

Here cpu MHz means current cpu frequency.
You can run cpufreq-info to understand easily.

Answered By: alhelal

This is my favorite:

watch -n1 "grep 'MHz' /proc/cpuinfo"

Although if you have Turbo Boost (or Turbo Core if AMD), you may prefer the following, which uses cpupower from the linux-tools group:
* On my system, both work equally well though.

sudo watch -n 1 -d cpupower monitor

Thanks @Zanna for point out the useless use of cat in the comments.

Answered By: Marc.2377

I’d like to point out sudo is needed for Ian’s answer above:

sudo cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq

However you can get the same results without sudo using:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq

My favourite is to use Conky where you can paint your own picture:

Conky.gif

This sits on the right of my built-in display all the time. The relevant code for the CPU section is:

${color2}${voffset 5}Intel® i-7 3630QM 3.4 GHz: ${color1}@  ${color green}${freq} MHz   
${color}${goto 13}CPU 1 ${goto 81}${color green}${cpu cpu1}% ${goto 131}${color3}${cpubar cpu1 18}
${color}${goto 13}CPU 2 ${goto 81}${color green}${cpu cpu2}% ${goto 131}${color3}${cpubar cpu2 18}
${color}${goto 13}CPU 3 ${goto 81}${color green}${cpu cpu3}% ${goto 131}${color3}${cpubar cpu3 18}
${color}${goto 13}CPU 4 ${goto 81}${color green}${cpu cpu4}% ${goto 131}${color3}${cpubar cpu4 18}
${color}${goto 13}CPU 5 ${goto 81}${color green}${cpu cpu5}% ${goto 131}${color3}${cpubar cpu5 18}
${color}${goto 13}CPU 6 ${goto 81}${color green}${cpu cpu6}% ${goto 131}${color3}${cpubar cpu6 18}
${color}${goto 13}CPU 7 ${goto 81}${color green}${cpu cpu7}% ${goto 131}${color3}${cpubar cpu7 18}
${color}${goto 13}CPU 8 ${goto 81}${color green}${cpu cpu8}% ${goto 131}${color3}${cpubar cpu8 18}
${color1}All CPU ${color green}${cpu}% ${goto 131}${color1}Temp: ${color green}${hwmon 2 temp 1}°C ${goto 250}${color1}Up: ${color green}$uptime
Answered By: WinEunuuchs2Unix

In a Linux terminal type the following command to get the CPU core name and it’s current speed:

cat /proc/cpuinfo | grep -E "model name|cpu MHz";

Answered By: Francisco Costa

sudo powertop then hit Tab twice to get to the “Frequency stats” tab.

It displays Actual frequency (accurate on my Laptop, as opposed to dmidecode), along with stats about how long is spent in each available frequency.

Answered By: Rolf

Here is a straightforward way to get cpu frequencies for all CPU threads:

  1. Be sure that cpufrequtils is installed.

  2. Then in a terminal, run the following command:

    cpufreq-info | grep "frequency is"
    
Answered By: Hypersphere

If you are using an embedded ARM device (such as a Raspberry or ARM based phones), you will not be able to use solutions using lscpu, dmidecode or /proc/cpuinfo because the current speed is not listed there, if the tool is at all available. Instead you have to use sysfs:

alias getcpuf='i=1; for x in $(sudo cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq); do y=$(($x/1000)); echo "CPU-${i}: $y MHz"; i=$((i+1)); done;'

# getcpuf
CPU-1: 600 MHz
CPU-2: 600 MHz
CPU-3: 600 MHz
CPU-4: 600 MHz
Answered By: not2qubit

This works fine for real-time processor speeds

 watch "grep 'cpu MHz' /proc/cpuinfo"

While this is active, you can also spam the processor to see what maximum real-time speeds it can reach by openssl speed

Answered By: Zenquiorra

The gnome tweak Vitals shows to my mind more accurately to 2.5 (even 2.7Ghz) of my Ryzen 2500, others showed 2Gz. ( pdfsandwich OCR’ing a pdf file is a good tester as it maxes out all CPUs)

https://extensions.gnome.org/extension/1460/vitals/

Answered By: pierrely

run command sudo i7z, the benefit of this command is it will tell real time cpu frequency with other information like temperature as well.I used to use sensors for temperature but it showed one time temperature. This command start a process with shows real time information.

Answered By: AASHISH SHARMA

Please note that /proc/cpuinfo contains wrong values. Because of that I use this:

watch -n2 "cpufreq-info | grep 'current CPU'"

Result:
enter image description here

And here the wrong result of /proc/cpuinfo:
enter image description here

Answered By: mgutt

Ubuntu 22.04 no longer provides the current CPU speed in lscpu without the extra flags -ae so to get the average cpu speed I have a cpuspeed script in /usr/local/bin/:

data=`lscpu -ae | cut -c 61-69 | grep -iv MHz`
total=0.001
count=0
while read -r line
do
    total=`awk "BEGIN {z=$total + $line; print z}"`
    let count+=1
done <<< $data
avg=`echo $total / $count | bc`
echo $avg

All it does is print out the average cpu speed in MHz. If you want to continually monitor it, call it from watch.

Whilst I like i7z this produces the number without having to install anything or having lots of other stuff around it.

(assigning 0.001 to total is my hack to ensure that the floating point math works and I’m sure everyone will criticise me for have three different math methods in 3 lines! Please don’t bash my Bash)

Answered By: rolandw
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.