mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
feat: native but poor method to get a component's temperature in linux
This commit is contained in:
@@ -1,19 +1,35 @@
|
|||||||
# Check the temperature of components
|
# Check the temperature of components
|
||||||
|
|
||||||
See [lm-sensors], [hddtemp] or [nvme-cli].
|
## TL;DR
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# 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
|
## Sources
|
||||||
|
|
||||||
- [How to check CPU temperature on Ubuntu Linux]
|
- [How to check CPU temperature on Ubuntu Linux]
|
||||||
|
- [Find out CPU temperature from the command-line]
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
References
|
References
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Knowledge base -->
|
<!-- Knowledge base -->
|
||||||
[hddtemp]: hddtemp.md
|
|
||||||
[lm-sensors]: lm-sensors.md
|
[lm-sensors]: lm-sensors.md
|
||||||
[nvme-cli]: nvme-cli.md
|
[nvme-cli]: nvme-cli.md
|
||||||
|
|
||||||
<!-- Others -->
|
<!-- Others -->
|
||||||
|
[find out cpu temperature from the command-line]: https://www.baeldung.com/linux/cpu-temperature
|
||||||
|
[hddtemp]: https://wiki.archlinux.org/title/Hddtemp
|
||||||
[how to check cpu temperature on ubuntu linux]: https://www.cyberciti.biz/faq/how-to-check-cpu-temperature-on-ubuntu-linux/
|
[how to check cpu temperature on ubuntu linux]: https://www.cyberciti.biz/faq/how-to-check-cpu-temperature-on-ubuntu-linux/
|
||||||
|
|||||||
Reference in New Issue
Block a user