4

I'm running Ubuntu 16.04. How can I find out what frequency my computer's CPU has? I just need to know the CPU frequency according to the manufacturer and the real CPU frequency I have.

Are there some terminal commands allowing that?

EDIT

There is output from lscpu

CPU MHz:               1400.042
CPU max MHz:           2700.0000
CPU min MHz:           800.0000

but from details i get another

enter image description here

the first output 2.7 and another 1.7 ...

It is because of Turbo boost?

2 Answers 2

9

The command lscpu gives you info about your CPU.

To restrict the output to the frequency, use this command:

lscpu | grep MHz

The output looks something like

CPU MHz:               828.140
CPU max MHz:           3600.0000
CPU min MHz:           800.0000

and shows you your CPU's current frequency, its maximum frequency, and its minimum frequency.

You can also click onto "Details" in the system settings. There is an entry called "Processor" which shows you your processor's name. This name probably contains the rated CPU frequency. Example: Intel® Core™ i7-4720HQ CPU @ 2.60GHz × 8

Note that the maximum frequency lscpu can be higher than the rated frequency. This is due to Turbo Boost.

6
  • Aww man. You were a few seconds faster than me... :P Have an upgoat.
    – Byte Commander
    Oct 15, 2016 at 18:10
  • Conversely, lscpu can give low values for e.g. laptops running on battery, because the system intentionally declocks the hardware to preserve battery life, when there isn't anything using that time.
    – Kroltan
    Oct 15, 2016 at 19:22
  • 1
    @Kroltan, hopefully all processors since the P4/K8 era are being clocked down by Ubuntu, even desktops. The default cpufreq governor is ondemand.
    – oldtechaa
    Oct 16, 2016 at 2:15
  • I edited my question, you said about it? Turbo boost i mean
    – Sirop4ik
    Oct 16, 2016 at 6:40
  • @AlekseyTimoshchenko Yes, exactly. Your CPU is designed to run at 1.7 GHz but it's possible for it to step above it up to a frequency of 2.7 GHz for a short period of time if certain limits aren't reached. For example, the current flowing through the CPU can't be too high, nor can its temperature be too high. Turbo boost is particularly handy if you're starting your PC and it's been off for a while so the CPU and its heat sink are cold. It can then be active for 15 or even 25 seconds straight.
    – UTF-8
    Oct 16, 2016 at 13:01
5

The first answer is a great one. The OP asked for "some" terminal commands. I'll throw in some extras, because every question can have many answers.

This is another way of seeing current frequencies for EVERY CPU:

rick@dell:~$  sudo cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq
[sudo] password for rick: 
2911523
2978173
2825097
3068554
2888232
2038769
2891894
3134619
────────────────────────────────────────────────────────────────
rick@dell:~$ 

You can shorten the above output by replacing * with a given CPU number such as 0 for the first CPU or 7 for the last CPU (on an 8 CPU system).

Another way of getting CPU frequencies without sudo powers is:

rick@dell:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
3174316
3223095
3250781
3214160
3211962
3222802
3237451
3245654
────────────────────────────────────────────────────────────────
rick@dell:~$ 

These are other commands in regards to Frequencies and the CPU that you might like to try out:

cat /sys/class/thermal/thermal_zone*/temp
cat /sys/devices/system/cpu/intel_pstate/no_turbo
cat /sys/devices/system/cpu/intel_pstate/turbo_pct
cat /sys/devices/system/cpu/intel_pstate/num_pstates
cat /sys/devices/system/cpu/intel_pstate/min_perf_pct
cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_min_freq
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_transition_latency
cat /sys/devices/system/cpu/cpu*/cpufreq/affected_cpus
cat /sys/devices/system/cpu/cpu*/cpufreq/related_cpus
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors 
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_setspeed 
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver

Once again you can replace * with a given CPU number to shorten output.

5
  • 1
    You might consider noting that this type of file is exactly where lscpu reads from :)
    – cat
    Oct 16, 2016 at 0:20
  • 1
    @cat as does lm-sensors and many other third party tools. Indeed I didn't come up with all these examples on the spur of the moment they come from a LibreOffice Calc spreadsheet that runs these commands and returns the output to neighbouring cells. I've built up the list of commands over time reading websites. There are other sections for network, usb, nvidia, grub, etc. Well at least I used backticks this time ;) Oct 16, 2016 at 0:25
  • Why don't you just write bash scripts for those things? It'd be a lot easier on machines that don't have LibreOffice handy.
    – oldtechaa
    Oct 16, 2016 at 2:14
  • @oldtechaa I use LibreOffice to be a master controller of bash commands to find out everything about my system (that is of interest to me) and store the results (output) in the spreadsheet. If I put the commands in a bash script where would the output be stored so I can format it via drill down? I simply add interesting commands and run the spreadsheet from time to time which takes a few seconds to run hundreds of bash commands. Oct 16, 2016 at 2:20
  • 1
    I just like reading a text, so I would have everything dump to text. :)
    – oldtechaa
    Oct 16, 2016 at 2:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .