Last active
June 10, 2020 22:39
-
-
Save maejok-xx/d3b343b063d58ce0ff2450c1420627d5 to your computer and use it in GitHub Desktop.
Linux CPU Temperature Shell Script
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 | |
cpu_temp=$(</sys/class/thermal/thermal_zone0/temp) | |
cpu_temp_c=$((cpu_temp/1000)) | |
cpu_temp_f=$(echo "scale=0;((9/5) * $cpu_temp_c) + 32" | bc) | |
echo "${cpu_temp_c}C / ${cpu_temp_f}F" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment