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:

I am using Conky to display a lot of information of my system. I managed to display the load percentage per core. But I do not know how to display the clock frequency of each core. What I have now is:

${font sans-serif:bold:size=8}PROCESSORS ${hr 2}${font}
CPU1: ${cpu cpu1}% $alignr ${freq} MHz $alignr ${cpubar cpu1 8,60}
CPU2: ${cpu cpu2}% $alignr ${freq} MHz $alignr ${cpubar cpu2 8,60}
CPU3: ${cpu cpu3}% $alignr ${freq} MHz $alignr ${cpubar cpu3 8,60}
CPU4: ${cpu cpu4}% $alignr ${freq} MHz $alignr ${cpubar cpu4 8,60}
CPU5: ${cpu cpu5}% $alignr ${freq} MHz $alignr ${cpubar cpu5 8,60}
CPU6: ${cpu cpu6}% $alignr ${freq} MHz $alignr ${cpubar cpu6 8,60}
CPU7: ${cpu cpu7}% $alignr ${freq} MHz $alignr ${cpubar cpu7 8,60}
CPU8: ${cpu cpu8}% $alignr ${freq} MHz $alignr ${cpubar cpu8 8,60}

But this only gives me the global clock frequency and not the individual clock frequency per core. Does someone know how to get the individual clock frequency per core?

System information

  • Linux Mint 13 KDE, 64 bit (based on Ubuntu 12.04)
  • Intel i7-2670QM (quad core with multithreading)
share|improve this question

marked as duplicate by Mitch, karel, Aditya, Jorge Castro, Florian Diesch Oct 29 '13 at 19:03

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.

1 Answer 1

up vote 0 down vote accepted

With conky you can execute an external command. So /proc/cpuinfo has all the info you need. see:

root@host:~$ cat /proc/cpuinfo | grep "cpu MHz"
cpu MHz         : 2667.000
cpu MHz         : 1998.000
cpu MHz         : 1998.000
cpu MHz         : 2667.000

In my case there are 4 cores and two of them are one step down. You can find out which steps your CPU allows with a tool called cpufreq-info:

root@host:~$ cpufreq-info | grep "available frequency steps"
  available frequency steps: 2.67 GHz, 2.00 GHz
  available frequency steps: 2.67 GHz, 2.00 GHz
  available frequency steps: 2.67 GHz, 2.00 GHz
  available frequency steps: 2.67 GHz, 2.00 GHz

This package can be installed by the command:

apt-get install cpufrequtils

With this information I would write your conky.conf like this

${font sans-serif:bold:size=8}PROCESSORS ${hr 2}${font}
CPU1: ${cpu cpu1}% $alignr ${exec awk '/cpu MHz/{i++}i==1{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignr ${cpubar cpu1 8,60}
CPU2: ${cpu cpu2}% $alignr ${exec awk '/cpu MHz/{i++}i==2{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignr ${cpubar cpu2 8,60}
CPU3: ${cpu cpu3}% $alignr ${exec awk '/cpu MHz/{i++}i==3{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignr ${cpubar cpu3 8,60}
CPU4: ${cpu cpu4}% $alignr ${exec awk '/cpu MHz/{i++}i==4{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignr ${cpubar cpu4 8,60}
CPU5: ${cpu cpu5}% $alignr ${exec awk '/cpu MHz/{i++}i==5{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignr ${cpubar cpu5 8,60}
CPU6: ${cpu cpu6}% $alignr ${exec awk '/cpu MHz/{i++}i==6{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignr ${cpubar cpu6 8,60}
CPU7: ${cpu cpu7}% $alignr ${exec awk '/cpu MHz/{i++}i==7{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignr ${cpubar cpu7 8,60}
CPU8: ${cpu cpu8}% $alignr ${exec awk '/cpu MHz/{i++}i==8{printf "%.f",$4; exit}' /proc/cpuinfo} MHz $alignr ${cpubar cpu8 8,60}

In my case it worked, but i had only 4 cores.

share|improve this answer

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