Skip to content

Instantly share code, notes, and snippets.

@maejok-xx
Last active June 10, 2020 22:39
Show Gist options
  • Save maejok-xx/d3b343b063d58ce0ff2450c1420627d5 to your computer and use it in GitHub Desktop.
Save maejok-xx/d3b343b063d58ce0ff2450c1420627d5 to your computer and use it in GitHub Desktop.
Linux CPU Temperature Shell Script
#!/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