How to Find the CPU Temperature in Linux

If you are running a heavy computational workload on a Linux server (like rendering video, compiling a massive codebase, or running a machine learning model), your CPU will generate extreme heat. If it gets too hot, the motherboard will thermal throttle the processor, destroying your performance. If the cooling fails entirely, the server will crash to protect itself.

Because most Linux servers do not have a graphical desktop environment with fancy dashboard widgets, you must query the motherboard’s thermal sensors directly from the terminal. The fastest, most standard way to do this across almost all Linux distributions is by using the lm-sensors utility.

Method 1: The “sensors” Command (The Industry Standard)

Before you can check the temperature, you must ensure the sensor reading package is actually installed on your operating system. It is included by default on many modern distributions, but it takes five seconds to verify.

Step 1: Install the Package

  1. Open your terminal or SSH into your server.
  2. If you are on Ubuntu/Debian, type this command and press Enter:

sudo apt install lm-sensors

  1. If you are on CentOS/RHEL/Fedora, type this command and press Enter:

sudo yum install lm_sensors

Step 2: Detect the Hardware

Once the package is installed, you must tell it to scan your specific motherboard to map out where the thermal sensors are located.

  1. Type this command:

sudo sensors-detect

  1. The terminal will print a massive wall of text and ask you a series of YES/NO questions (e.g., “Do you want to scan for Super I/O sensors?”).
  2. Simply press the Enter key repeatedly to accept the default “YES” answer to every single question.

Step 3: Read the Temperature

Now that the system is configured, you can check your CPU temperature at any time with a single word.

  1. Type this command:

sensors

  1. Press Enter.

The terminal will print a clean readout of your hardware. Look for the section labeled coretemp (or something similar, depending on your CPU brand). It will list the exact temperature of every single physical core inside your processor (e.g., Core 0: +45.0°C).

It will also list the High (the warning limit) and the Crit (the critical thermal shutdown limit, usually around 100°C). If your current temperature is dangerously close to the “Crit” limit, you must stop your workload immediately.

Method 2: Read the Raw Thermal Files (No Installation Required)

If you are on a highly restricted server where you are not allowed to use apt or yum to install new software packages, you cannot use the sensors command. However, the Linux kernel constantly writes hardware temperature data directly into text files hidden in the system directory. You can simply read these files.

  1. Type this command exactly:

cat /sys/class/thermal/thermal_zone0/temp

  1. Press Enter.

The terminal will print a single string of numbers (e.g., 45000). Because this is raw kernel data, it is not formatted for humans. It is printed in millidegrees Celsius. You must divide the number by 1000 in your head.

Therefore, a reading of 45000 means your CPU is currently 45.0°C.

(Note: Depending on your motherboard architecture, your primary CPU sensor might be located at thermal_zone1 or thermal_zone2 instead. You can list all available thermal zones by typing ls /sys/class/thermal/).

Method 3: Live Monitoring with the “watch” Command

The sensors command only provides a static snapshot of your temperature at the exact millisecond you pressed Enter. If you are actively stress-testing your server and want to watch the temperatures rise in real-time, you can loop the command.

  1. Type this command:

watch -n 1 sensors

  1. Press Enter.

This tells the terminal to run the sensors command automatically every 1 second and refresh the screen. You will now have a live, real-time dashboard of your CPU thermals. To exit the live monitor and return to the normal terminal, press Ctrl + C.

Get the best tech tips delivered straight to your inbox.

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