The Raspberry Pi has a few temperature sensors built in. One of the most important is in the GPU. This is because the Raspberry Pi will start throttling back it’s processing power if the temperature start getting close to 80deg C. Here is how to check the temperature from the command line.
Checking the GPU temperature:
$ vcgencmd measure_temp
Checking the CPU current temperature:
$ cat /sys/class/thermal/termal_zone0/temp
See: https://www.cyberciti.biz/faq/linux-find-out-raspberry-pi-gpu-and-arm-cpu-temperature-command/