Created
April 9, 2022 13:33
-
-
Save RCasatta/c8a2f956288ff50d2e81ff4748dbde0e to your computer and use it in GitHub Desktop.
Set the max frequency of the CPU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# verify your available scaling frequency with: | |
# `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies` | |
# and adapt this script | |
unset FREQ | |
case $1 in | |
min) | |
FREQ=1400000 | |
;; | |
med) | |
FREQ=1700000 | |
;; | |
max) | |
FREQ=1800000 | |
;; | |
status) | |
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq | |
;; | |
*) | |
echo "Use cpufreq.sh min|med|max|status" | |
;; | |
esac | |
if ! [ -z ${FREQ+x} ]; then | |
for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq; | |
do sudo sh -c "echo $FREQ > $file;" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment