CPU Clock

To save power, cpu manufacturers programmatically reduce the frequency of the processor. You can find out the current and possible frequency with the command:

grep '' /sys/devices/system/cpu/cpu0/cpufreq/scaling_{min,cur,max}_freq

Example command output:

/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq:800000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:1400000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq:2300000

Here we can see that the current processor frequency-1400 Mhz and the maximum-2300 Mhz Create the script cpu_frequency.sh:

#!/bin/bash

cpucount=$(grep -c 'model name' /proc/cpuinfo)
sysdir=/sys/devices/system/cpu
for cpu in $(eval echo cpu{0..$((cpucount-1))}); do
        cat $sysdir/$cpu/cpufreq/scaling_max_freq > $sysdir/$cpu/cpufreq/scaling_min_freq
done

Set the execute permissions and execute this script:

chmod +x cpu_frequency.sh
bash ./cpu_frequency.sh

Check now the frequency of the processor:

grep '' /sys/devices/system/cpu/cpu0/cpufreq/scaling_{min,cur,max}_freq

Example output:

/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq:2300000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:2300000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq:2300000

As you can see-the processor frequency has become 2300 Mhz-that is, the maximum.