Linux kernel uses /sys subsystem to store and communicate system information and states. Temperature informations could also be obtained from the subsystem, with the caveat that the information is not in standard location and format as it differs between hardware models or manufacturers along with the associated kernel module.
lm-sensors via libsensors try to address the issue by mapping these informations into an easily accessible interface for other programs to read and configure the values. It also provides userland tools for finding and reporting these values.
You can use lm-sensors to view information such as CPU and overall system temperature in Linux from the terminal.
$ sudo pacman -S lm_sensors # Mint $ sudo yum install --assumeyes lm_sensors #Red Hat, CentOS $ sudo dnf install lm_sensors # Fedora $ sudo apt update && sudo apt install --assume-yes lm-sensors #Ubuntu, Debian $ sudo zypper in sensors #SUSE
$ sudo sensors-detect --auto # sensors-detect revision $Revision$ # System: Dell Inc. Latitude E5470 (laptop) # Board: Dell Inc. 0VHKV0 # Kernel: 5.0.0-20-generic x86_64 # Processor: Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz (6/78/3) Running in automatic mode, default answers to all questions are assumed. Some south bridges, CPUs or memory controllers contain embedded sensors. Do you want to scan for them? This is totally safe. (YES/no): Module cpuid loaded successfully. Silicon Integrated Systems SIS5595... No VIA VT82C686 Integrated Sensors... No VIA VT8231 Integrated Sensors... No AMD K8 thermal sensors... No AMD Family 10h thermal sensors... No AMD Family 11h thermal sensors... No AMD Family 12h and 14h thermal sensors... No AMD Family 15h thermal sensors... No AMD Family 16h thermal sensors... No AMD Family 17h thermal sensors... No AMD Family 15h power sensors... No AMD Family 16h power sensors... No Intel digital thermal sensor... Success! (driver `coretemp') ##### snipped Client found at address 0x52 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... Yes (confidence 8, not a hardware monitoring chip) Next adapter: i915 gmbus dpc (i2c-1) Do you want to scan it? (yes/NO/selectively): Next adapter: i915 gmbus dpb (i2c-2) Do you want to scan it? (yes/NO/selectively): Next adapter: i915 gmbus dpd (i2c-3) Do you want to scan it? (yes/NO/selectively): Next adapter: DPDDC-A (i2c-4) Do you want to scan it? (yes/NO/selectively): Next adapter: DPDDC-C (i2c-5) Do you want to scan it? (yes/NO/selectively): Now follows a summary of the probes I have just done. Driver `coretemp': * Chip `Intel digital thermal sensor' (confidence: 9) To load everything that is needed, add this to /etc/modules: #----cut here---- # Chip drivers coretemp #----cut here---- If you have some drivers built into your kernel, the list above will contain too many modules. Skip the appropriate ones! Do you want to add these lines automatically to /etc/modules? (yes/NO) Unloading cpuid... OK
$ sudo systemctl start lm-sensors
$ sudo systemctl enable lm-sensors Synchronizing state of lm-sensors.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable lm-sensors
$ sensors iwlwifi-virtual-0 Adapter: Virtual device temp1: +32.0°C pch_skylake-virtual-0 Adapter: Virtual device temp1: +33.0°C acpitz-acpi-0 Adapter: ACPI interface temp1: +25.0°C (crit = +107.0°C) coretemp-isa-0000 Adapter: ISA adapter Package id 0: +34.0°C (high = +100.0°C, crit = +100.0°C) Core 0: +34.0°C (high = +100.0°C, crit = +100.0°C) Core 1: +34.0°C (high = +100.0°C, crit = +100.0°C) dell_smm-virtual-0 Adapter: Virtual device Processor Fan: 0 RPM CPU: +34.0°C Ambient: +31.0°C SODIMM: +33.0°C Other: +32.0°C
Harddrive temperature information is not available via lm-sensors but could be viewed using hddtemp.
Related: How to view harddrive temperature in Linux
Comment anonymously. Login not required.