Files
oam/knowledge base/check the temperature of components.md

1.1 KiB

Check the temperature of components

TL;DR

# Show the current temperature of thermal zones in millidegrees C.
cat '/sys/class/thermal/thermal_zone'*'/temp'

# Show the current temperature of the CPU package in millidegrees C.
grep 'x86_pkg_temp' '/sys/class/thermal/thermal_zone'*'/type' | cut -d':' -f1 | xargs dirname | xargs -I{} cat {}'/temp'

# Show all types with relative temperature in degrees C.
paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) \
| column -s $'\t' -t | sed 's/\(.\)..$/.\1°C/'

See lm-sensors, hddtemp or nvme-cli for better ways.

Sources