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?
From the command line type
lscpu
. The information will be at CPU MHz:There are a couple of ways:
lscpu
or more preciselscpu | grep "MHz"
.This will give you the general MHz for the CPU.
cat /proc/cpuinfo
or more precisecat /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.
lshw -c cpu
or more precise version:lshw -c cpu | grep capacity
Will give you the general MHz. Same as
lscpu
.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.Out of all of this,
lshw
anddmidecode
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 speedcat /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 thedmesg
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 thecat /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.For the current CPU speed one can dynamically watch this change in real time using:
To see the maximum CPU speed, use:
indicator-cpufreq-selector is a nice little indicator tool which shows your current cpu frequency. You can even select the desired cpu frequency.
However last update for this tool was on 2015-10-19.
This works fine for real-time processor speeds
While this is active, you can also spam the processor to see what maximum real-time speeds it can reach by
openssl speed
I'd like to point out
sudo
is needed for Ian's answer above:However you can get the same results without sudo using:
My favourite is to use Conky where you can paint your own picture:
This sits on the right of my built-in display all the time. The relevant code for the CPU section is:
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.This is my favorite:
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.
Thanks @Zanna for point out the useless use of
cat
in the comments.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: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.