How to Check Your CPU Temperature in the Linux Terminal

Monitoring your system hardware is a critical responsibility for any Linux administrator. Whether you are running a heavy computational workload on an Ubuntu server, mining cryptocurrency, or simply playing modern games on a Linux desktop, excessive heat can cause thermal throttling and permanent hardware degradation. Learning how to check your CPU temperature in Linux directly from the command line is an essential troubleshooting skill that requires no heavy graphical interfaces.

In this technical guide, we will demonstrate how to install and configure the widely used lm-sensors utility, which pulls real-time thermal data directly from your motherboard’s hardware sensors.

Step 1: Install the lm-sensors Package

While some modern Linux distributions come with basic thermal monitoring tools pre-installed, the industry standard is the lm-sensors package. It is lightweight, highly accurate, and available in almost all default software repositories.

To install it on Debian or Ubuntu-based systems, open your terminal and run the following command:

sudo apt update && sudo apt install lm-sensors

If you are using a Red Hat, Fedora, or CentOS-based distribution, use the DNF package manager instead:

sudo dnf install lm_sensors

Step 2: Detect Your Hardware Sensors

Before the software can report any temperatures, it needs to scan your specific motherboard and processor to identify which hardware sensors are physically available. You only need to perform this step once.

  1. In your terminal, execute the detection script by typing: sudo sensors-detect
  2. The script will ask you a series of questions about which system buses and kernel modules to probe.
  3. For the vast majority of systems, it is completely safe to press Enter to accept the default YES answer for every prompt.
  4. At the very end of the script, it will ask if you want to automatically add the required kernel modules to your configuration files. Type yes and press Enter.

Note: You may need to restart your computer or run sudo systemctl restart kmod for the newly discovered sensors to become active.

Step 3: Check Your CPU Temperature

Once the setup is complete, checking your current temperature takes only a fraction of a second.

Simply open your terminal and type:

sensors

The terminal will output a list of all detected hardware components. Look for the section labelled coretemp or k10temp (depending on whether you have an Intel or AMD processor). Underneath this, you will see the exact temperature of your CPU in degrees Celsius, alongside the “high” and “critical” thresholds defined by the manufacturer.

Frequently Asked Questions

How do I monitor the temperature in real-time?

If you want to watch the temperature fluctuate while you run a heavy workload, you can use the watch command to refresh the output every two seconds. Simply type: watch sensors. To exit the real-time view, press Ctrl + C.

By regularly monitoring your thermal data, you can preemptively identify failing cooling fans or dried-out thermal paste before they cause catastrophic system failures.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.