Getting the Raspberry Pi temperature from the command-line
If you are overclocking your Raspberry Pi or you just curious how hot this little guy gets, there are two ways to get the internal temperature. Assuming you are running Raspbian as your operating system.
$ /opt/vc/bin/vcgencmd measure_temp
This gives you the temperate in in degrees Celsius:
If you need the temperature to be more precise (e.g. storing it in an database or for further processing) use the following command:
$ cat /sys/class/thermal/thermal_zone0/temp
This will give you the temperature in Millidegrees Celsius:
From my personal experience the temperature ranges from about 50°C to 55°C and I have never seen my Raspberry Pi running over 58°C.