How to get the CPU temperatur in command linux on Linux?

Most modern servers or computers have sensors to detect the temperature of various components. On Linux, how to get the CPU core temperatur in command linux?

First, make sure the package “lm-sensors” is installed on your Linux and the command sensors works for you.

Then, you can use this piece of script to get the CPU temperature:

sensors 
| grep 'Core 0' 
| awk '{print $3}' 
| rev | cut -b4- | rev | cut -b2-

Similar Posts

Leave a Reply

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