Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

All programs I've tried seem to be listing Hz from cpu's specifications not actually checking what the current Hz really is.

for example a processor is marketed with 4GHz.But this is the max (unless you over/under/clock) and if the cpu isn't doing anything or is getting too hot it will throttle down.

The program always will say 4Ghz even when the CPU is at 2Ghz.I want to avoid this and know the real Hz.

What programs actually check current cpu hz and not just read cpu specifications?

share|improve this question

marked as duplicate by Rinzwind, Takkat, terdon, psusi, Eric Carvalho Apr 8 at 19:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
I want the program to show the Hz in realtime if possible. –  fdsfgdsdf Apr 8 at 18:18
    
askubuntu.com/questions/218567/… ( sudo dmidecode -t processor | grep "Speed" ) –  Rinzwind Apr 8 at 18:23
    
@Rinzwind I like this the most because it displays cpu hz ever ysecond. sudo watch -n 1 cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq but I dont have cpu folder in cpu folder so I get no such file or directory.What should I do? –  fdsfgdsdf Apr 8 at 18:39
    
ok but I would added it to the link 3 people accepted as duplicate ;) –  Rinzwind Apr 8 at 18:40

1 Answer 1

up vote 2 down vote accepted

You can easily check the current CPU frequency using the following command:

watch -n 0 "lscpu | grep 'MHz'"

You can also get the current cpu frequency with this command:

cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq

Most modern CPUs can adjust their clock frequency. The default governor on linux is "on demand" which keeps the clock speed low to save power when idle, and speeds it up to do work when needed.

Visit https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt for further details.

share|improve this answer
    
Is the governor not working? I always see 2000MHz. –  fdsfgdsdf Apr 8 at 18:40
    
open close several applications, start VMs, it will change. Or maybe close all of them and wait a couple seconds to see the idle speed –  Sylvain Pineau Apr 8 at 18:41
    
I really mean always (unless I overclock)the same even if cpu usage is 100% –  fdsfgdsdf Apr 8 at 18:44
    
Try forcing the powersave mode with echo "powersave" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor –  Sylvain Pineau Apr 8 at 18:47
    
There is a small exception..: some programs show the Hz as 2000.xxx where xxx is different on every boot (I guess boot) now it is 2000.175 Why does the xxx number change? –  fdsfgdsdf Apr 8 at 18:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.