Contolling the CPU Governor in Linux

Recently I wondered how you control CPU throttling in GNU/Linux systems so after doing a little research this script is what I’ve come up with. It’s based on some others that I’ve come across. All it does is set the CPU throttling mode to “performance” then displays the current CPU frequency setting, which should be full speed.

for CPUGOV in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
    echo -n performance > $CPUGOV;
# Display Stats about new settings
grep -E '^model name' /proc/cpuinfo | head -n 1
for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
    cat  $CPUFREQ | awk '{ print $1 / 1e6 "GHz"; }'
exit 0