Last active
February 18, 2021 15:39
-
-
Save aelveborn/8127860 to your computer and use it in GitHub Desktop.
Bash script to enable / disable turbo on the CPU in Linux. Change permissions: sudo chmod a+x switch-turbo.sh
Run the script: sudo ./switch-turbo.sh
This file contains 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 | |
status=$(head /sys/devices/system/cpu/intel_pstate/no_turbo | grep -o '[0-1]') | |
if [ $status = 0 ]; then | |
echo "Switching CPU-turbo: OFF" | |
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo | |
else | |
echo "Switching CPU-turbo: ON" | |
echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful but over on my branch I cleaned up the subcommand for
status
. Nothing much but is a bit cleaner.