Monitor Processor Temperature From The Command Line

By | November 13, 2011

Do you ever need to/want to know how hot your processors are running? There’s a way!

Sure, there are handy gui tools for things like this, but for our purposes, sometimes a quick, clean little shell code snippet gets the job done quite nicely. Take, for instance when you are running something CPU intensive, like transcoding video with handbrake or maybe folding proteins. Those kinds of computations really give your processor(s) a heavy workout, and often run them up to hotter than recommended temperatures (usually ~40 degrees celcius) which can shorten their lifespan.

This little bash function will help you keep an eye on things. First, you need to install the sensors package for your Linux distribution. Then run the sensors-detect command with root privileges (sudo) to get your sensors configured. *CAVEAT: sorry laptop/netbook users, your hardware doesn’t usually have sensors.

After running the sensors-detect command, you’re ready. Pop this little bit of code into your ~/.bashrc file and the next time you open a terminal, you will be able to simply type "coretemp" and get a live view of the temperature of your processor cores.

And that’s it. One more little tip for you is that you can use that sensors command (even without root privileges) to get other great information if your hardware supports it, such as fan speed and bus stats.