Skip to content

Instantly share code, notes, and snippets.

@kamilmirza
Created February 12, 2019 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamilmirza/0f4a5881c69924653cb2febd06567447 to your computer and use it in GitHub Desktop.
Save kamilmirza/0f4a5881c69924653cb2febd06567447 to your computer and use it in GitHub Desktop.
view cpu temp by 1s delay
#!/bin/bash
while true
do
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 %$cpuTemp1))
wdate=`date +%H:%M:%S`
echo "CPU temp = $cpuTemp1.$cpuTempM_C : $wdate"
#echo "GPU $(/opt/vc/bin/vcgencmd measure_temp)"
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment