Check CPU temperature in Ubuntu
How To

Check CPU Temperature in Ubuntu Command Line

Sagar Sharma
Sagar Sharma

Table of Contents

Want to check the CPU temperature in the Ubuntu terminal?

Well, there are multiple tools to do so and in this tutorial, I will introduce 4 such tools to check CPU temperature in an Ubuntu terminal:

  1. lm-sensors
  2. Glances
  3. hardinfo
  4. i7z

So let's start with the first one.

1. Using the lm-sensors utility

By far this is the most popular utility to check the temperature in Linux and serves as a backend for so many GUI utilities that lets you check CPU temps.

Being super popular, lm-sensors is available in the default repository of Ubuntu and can easily be installed with the following command:

sudo apt install lm-sensors

Once done, use the following command to detect the sensors of your system:

sudo sensors-detect

After you execute the above command, it will ask you several questions for various adapters whether you want to check their temperature or not.

I would recommend going with the default opinions (press the Enter key for that):

detect sensors using the sensors utility

Now, you can execute the sensors command to check the temperature:

sensors
Use the sensors utility to check temprature in Ubuntu
ūüí°
If your CPU reaches a high temperature, check if some program is consuming too much processing power. Validate if it is normal. Cleaning your system for dust also helps in reducing the overheating.

2. Using the Glances utility

Glances does much more than just checking the CPU temperature.

It is more of an alternative to htop and lets you monitor network, memory utilization, and much more.

Like lm-sensors, glances is available in the default repository of Ubuntu and can be installed with the following command:

sudo apt install glances

Once done, start the glances utility:

glances
Use the glances utility in Ubuntu to check the CPU temprature in Ubuntu terminal

3. Using the hardinfo utility

The hardinfo is a lightweight benchmarking utility and being a benchmarking utility, it is a no-brainer that you can also use it to check CPU temperature.

To install hardinfo in Ubuntu, use the following command:

sudo apt install hardinfo

Once done, execute the following command to

hardinfo -rma devices.so
Check the CPU temprature in Ubuntu using the hardinfo utility

4. Using the i7z utility

The i7z utility provides detailed information about the Intel i3, i5, and i7 processors including the CPU temperature.

To install i7z, all you have to do is execute the following command:

sudo apt install i7z

Once done, start the i7z utility to display CPU temperature:

sudo i7z

(give it a few seconds and soon you'll see live temperature):

Use the i7z utility to check CPU temprature in Ubuntu terminal

Pretty easy. Right?

Final words...

If interested, you can learn about getting more details about the CPU on your Ubuntu system.

How to Get CPU Info in Ubuntu
Here are various ways for getting the processor information in Ubuntu command line.

This was a quick tutorial showing multiple ways to check the CPU temperature in the Ubuntu terminal in the least complex way possible.

I hope checking CPU temperature is no longer a complex task for you.



Sagar Sharma

Sagar Sharma

A software engineer who loves to tinker with hardware till it gets crashed. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.