Skip to content

Instantly share code, notes, and snippets.

@chiro-hiro
Created September 1, 2021 11:00
Show Gist options
  • Save chiro-hiro/a6fdd13ff075081a6ccbb4b8b543b495 to your computer and use it in GitHub Desktop.
Save chiro-hiro/a6fdd13ff075081a6ccbb4b8b543b495 to your computer and use it in GitHub Desktop.
Get CPU,GPU temperature
#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment