Skip to content

Instantly share code, notes, and snippets.

@spajak
Last active August 5, 2022 20:42
Show Gist options
  • Save spajak/fc0fc1bfae72fb52a7165801176c7382 to your computer and use it in GitHub Desktop.
Save spajak/fc0fc1bfae72fb52a7165801176c7382 to your computer and use it in GitHub Desktop.
Raspberry Pi - get CPU and GPU temperature
#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone0/temp)
cpu=$(printf %.1f "${cpu}e-3")
gpu=$(vcgencmd measure_temp)
gpu=${gpu:5:-2}
echo "CPU: ${cpu} °C"
echo "GPU: ${gpu} °C"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment