设为首页收藏本站language→→ 语言切换

鸿鹄论坛

 找回密码
 论坛注册

QQ登录

先注册再绑定QQ

查看: 566|回复: 0
收起左侧

如何在Ubuntu Linux中获取CPU温度

[复制链接]
发表于 2021-4-19 02:14:56 | 显示全部楼层 |阅读模式

Lm_sensors是一个命令行工具,用于显示所有芯片传感器数据的当前读数,包括CPU温度。默认情况下,Ubuntu LInux没有安装Lm_Sensors,因此,我们必须自己安装它们。

bob@bob-PC:~$ sudo apt install lm-sensors检测硬件

接下来,我们需要检测安装在电脑上的硬件监控芯片。现在我们可以开始检测电脑的硬件传感器了:

bob@bob-PC:~$ sudo sensors-detect# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)# System: VMware, Inc. VMware Virtual Platform [None]# Board: Intel Corporation 440BX Desktop Reference Platform# Kernel: 4.15.0-30Ubuntu-generic x86_64# Processor: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (6/158/10)This program will help you determine which kernel modules you needto load to use lm_sensors most effectively. It is generally safeand recommended to accept the default answers to all questions,unless you know what you're doing.Some south bridges, CPUs or memory controllers contain embedded sensors.Do you want to scan for them? This is totally safe. (YES/no): yesSilicon Integrated Systems SIS5595...                       NoVIA VT82C686 Integrated Sensors...                          NoVIA VT8231 Integrated Sensors...                            NoAMD K8 thermal sensors...                                   NoAMD Family 10h thermal sensors...                           NoAMD Family 11h thermal sensors...                           NoAMD Family 12h and 14h thermal sensors...                   NoAMD Family 15h thermal sensors...                           NoAMD Family 16h thermal sensors...                           NoAMD Family 17h thermal sensors...                           NoAMD Family 15h power sensors...                             NoAMD Family 16h power sensors...                             NoIntel digital thermal sensor...                             Success!    (driver `coretemp')Intel AMB FB-DIMM thermal sensor...                         NoIntel 5500/5520/X58 thermal sensor...                       NoVIA C7 thermal sensor...                                    NoVIA Nano thermal sensor...                                  NoSome Super I/O chips contain embedded sensors. We have to write tostandard I/O ports to probe them. This is usually safe.Do you want to scan for Super I/O sensors? (YES/no): yes..................显示cpu温度

可以通过一下命令查看温度数据了:

bob@bob-PC:~$ sensorsiwlwifi_1-virtual-0Adapter: Virtual devicetemp1:        +33.0°C  pch_skylake-virtual-0Adapter: Virtual devicetemp1:        +38.5°C  BAT0-acpi-0Adapter: ACPI interfacein0:         +12.45 V  coretemp-isa-0000Adapter: ISA adapterPackage id 0:  +39.0°C  (high = +100.0°C, crit = +100.0°C)Core 0:        +39.0°C  (high = +100.0°C, crit = +100.0°C)Core 1:        +38.0°C  (high = +100.0°C, crit = +100.0°C)thinkpad-isa-0000Adapter: ISA adapterfan1:           0 RPMtemp1:        +38.0°C  temp2:            N/A  temp3:         +0.0°C  temp4:         +0.0°C  temp5:         +0.0°C  temp6:         +0.0°C  temp7:         +0.0°C  temp8:         +0.0°C  BAT1-acpi-0Adapter: ACPI interfacein0:         +12.49 V  acpitz-acpi-0Adapter: ACPI interfacetemp1:        +38.0°C  (crit = +128.0°C)

还可以使用watch命令实时关注:

bob@bob-PC:~$ watch sensors使用图形化工具psensor显示cpu温度

使用Psensor,您可以检查以下各项:

  • 主板、CPU传感器和NVidia GPU的温度
  • 硬盘驱动器的温度
  • 风扇的转速
  • 监视CPU使用情况

最新版本的Psensor还为Ubuntu提供了一个applet指示器,因此在Ubuntu上更容易监控硬件温度。您可以选择在顶部面板中显示温度。它甚至可以在温度超过极限时发送桌面通知。

我们可以使用下面的命令安装Psensor:

bob@bob-PC:~/Desktop$ sudo apt install -y psensor

打开ubuntu的launchpad,在里面找到psensor,打开该应用就可以看到多个传感器:


                               
登录/注册后可看大图


                               
登录/注册后可看大图

使用图形化工具hardinfo

Hardinfo是Linux中用于在图形化界面中显示硬件信息的工具。可以使用它检测cpu的温度。以下命令安装hardinfo:

bob@bob-PC:~/Desktop$ sudo apt install hardinfo# 运行一下命令打开hardinfobob@bob-PC:~/Desktop$ sudo hardinfo


                               
登录/注册后可看大图

总结

在本教程中,我们将学习如何从命令行和桌面获取Ubuntu Linux上的CPU温度。


您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2024-4-19 18:37 , Processed in 0.055332 second(s), 7 queries , Redis On.  

  Powered by Discuz!

  © 2001-2024 HH010.COM

快速回复 返回顶部 返回列表