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.
Method 1:
$ /opt/vc/bin/vcgencmd measure_temp This gives you the temperate in in degrees Celsius: temp=54.1'C
Method 2:
If you need the temperature to be more precise (e.g. storing it in an database or for further processing) use the following command: