The CPU or GPU temperature depends entirely on the usage of running programs or applications. Sensitive computer components such as CPUs have a finite lifespan and running them at a temperature that exceeds a certain limit (or at higher temperatures generally) can shorten it. Besides, it can also cause thermal throttling especially when the fan is not providing adequate cooling.
So it is important to monitor your system’s CPU temperature to avoid damaging it as a result of overheating. In this article, we will share some useful command-line tools to help you keep a close eye on the temperature of your CPU and GPU.
Glances is a cross-platform, advanced and popular real-time system monitoring tool that uses the psutil library to gather information from various system resources.
It can display information from sensors using the psutil and/or hddtemp tools. One of its intriguing features is the webserver mode which allows you to access it via a web browser to remotely monitor your Linux server.
There are various methods to install Glances on your system, but the preferred way of installing glances is using an auto-install script, which will install the latest production-ready version.
# curl -L https://bit.ly/glances | /bin/bash OR # wget -O- https://bit.ly/glances | /bin/bash
Once you have installed it, start Glances and press
f key to view sensors information.
Sensors is a simple command-line utility that displays the current readings of all sensor chips including the CPU. It comes pre-installed some Linux distributions such as Ubuntu by default, otherwise install it as shown.
$ sudo apt-get install lm-sensors
Then you can run the following command to detect all sensors on your system.
$ sudo sensors-detect
Once detected, you can run the following command to check CPU temperature, GPU temperature, fan speed, voltage, etc.
Recommended Read: Psensor – A Graphical Hardware Temperature Monitoring Tool for Linux
Hardinfo is a lightweight system profiler and benchmark tool designed for hardware analysis and report generation. It features comprehensive reports on system hardware and allows for the generation of HTML reports on your system’s hardware.
To install the hardinfo package on your Ubuntu Linux system, run the following command.
$ sudo apt install hardinfo
After the installation is complete, you can launch hardinfo to view devices’ information by running the following command.
$ hardinfo -rma devices.so
To launch the GUI app, simply run the following command or search for ‘System Profiler and Benchmark’ in the system menu or Dash and open it.
Then click on sensors to view sensors information as shown in the following screenshot.
i7z is a tiny command-line utility that reports Intel Core i7, i5, i3 CPU information including temperatures. You can install it on your Ubuntu system by running the following command.
$ sudo apt install i7z
Once installed, run i7z with root privileges as shown.
$ sudo i7z
You might also like to read these useful related articles.
- Limit CPU Usage of a Process in Linux with CPULimit Tool
- 9 Useful Commands to Get CPU Information on Linux
- Cpustat – Monitors CPU Utilization by Running Processes in Linux
- CoreFreq – A Powerful CPU Monitoring Tool for Linux Systems
That’s all for now! In this article, we have shared the useful command-line tools for viewing CPU and GPU temperatures in a Ubuntu system. Have your say about this article or ask questions via the feedback form below.