Linux工具 2、ls_sensors 查看Linux CPU温度

Linux 下查看CPU温度的方法

1、安装
CentOS 系列
yum -y install lm_sensors
Ubuntu 系列
apt-get install lm_sensors
2、使用
> sensors --help
Usage: sensors [OPTION]... [CHIP]...
  -c, --config-file     Specify a config file #指定配置文件
  -h, --help            Display this help text 
  -s, --set             Execute `set' statements (root only) #只有root用户才可以执行set语句
  -f, --fahrenheit      Show temperatures in degrees fahrenheit #以华氏度显示温度
  -A, --no-adapter      Do not show adapter for each chip  #不显示每个芯片的适配器,不显示每个核心CPU的温度。
      --bus-list        Generate bus statements for sensors.conf #总线
  -u                    Raw output
  -v, --version         Display the program version

Use `-' after `-c' to read the config file from stdin. #使用-c从stin读取配置文件。
If no chips are specified, all chip info will be printed. #如果没有指定芯片,将打印所有芯片信息。打印每个核心CPU的温度。
Example chip names:
    lm78-i2c-0-2d   *-i2c-0-2d
    lm78-i2c-0-*    *-i2c-0-*
    lm78-i2c-*-2d   *-i2c-*-2d
    lm78-i2c-*-*    *-i2c-*-*
    lm78-isa-0290   *-isa-0290
    lm78-isa-*  *-isa-*
    lm78-*
3、展示
> sensors
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +62.0°C  (high = +80.0°C, crit = +98.0°C)
Core 0:         +57.0°C  (high = +80.0°C, crit = +98.0°C)
Core 1:         +53.0°C  (high = +80.0°C, crit = +98.0°C)
Core 2:         +55.0°C  (high = +80.0°C, crit = +98.0°C)
Core 3:         +55.0°C  (high = +80.0°C, crit = +98.0°C)
Core 4:         +54.0°C  (high = +80.0°C, crit = +98.0°C)
Core 5:         +56.0°C  (high = +80.0°C, crit = +98.0°C)
Core 6:         +56.0°C  (high = +80.0°C, crit = +98.0°C)
Core 7:         +56.0°C  (high = +80.0°C, crit = +98.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Physical id 1:  +66.0°C  (high = +80.0°C, crit = +98.0°C)
Core 0:         +60.0°C  (high = +80.0°C, crit = +98.0°C)
Core 1:         +60.0°C  (high = +80.0°C, crit = +98.0°C)
Core 2:         +58.0°C  (high = +80.0°C, crit = +98.0°C)
Core 3:         +57.0°C  (high = +80.0°C, crit = +98.0°C)
Core 4:         +56.0°C  (high = +80.0°C, crit = +98.0°C)
Core 5:         +56.0°C  (high = +80.0°C, crit = +98.0°C)
Core 6:         +57.0°C  (high = +80.0°C, crit = +98.0°C)
Core 7:         +55.0°C  (high = +80.0°C, crit = +98.0°C)
4、小技巧

可以配合watch命令,以时间为间隔自动刷新当前CPU温度信息。

> watch -d -n 1 'sensors'
Every 1.0s: sensors                                                                                                                                     Sat Apr 13 01:58:59 2019

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +63.0°C  (high = +80.0°C, crit = +98.0°C)
Core 0:         +57.0°C  (high = +80.0°C, crit = +98.0°C)
Core 1:         +54.0°C  (high = +80.0°C, crit = +98.0°C)
Core 2:         +55.0°C  (high = +80.0°C, crit = +98.0°C)
Core 3:         +54.0°C  (high = +80.0°C, crit = +98.0°C)
Core 4:         +54.0°C  (high = +80.0°C, crit = +98.0°C)
Core 5:         +57.0°C  (high = +80.0°C, crit = +98.0°C)
Core 6:         +57.0°C  (high = +80.0°C, crit = +98.0°C)
Core 7:         +55.0°C  (high = +80.0°C, crit = +98.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Physical id 1:  +67.0°C  (high = +80.0°C, crit = +98.0°C)
Core 0:         +59.0°C  (high = +80.0°C, crit = +98.0°C)
Core 1:         +60.0°C  (high = +80.0°C, crit = +98.0°C)
Core 2:         +58.0°C  (high = +80.0°C, crit = +98.0°C)
Core 3:         +58.0°C  (high = +80.0°C, crit = +98.0°C)
Core 4:         +57.0°C  (high = +80.0°C, crit = +98.0°C)
Core 5:         +56.0°C  (high = +80.0°C, crit = +98.0°C)
Core 6:         +57.0°C  (high = +80.0°C, crit = +98.0°C)
Core 7:         +56.0°C  (high = +80.0°C, crit = +98.0°C)

你可能感兴趣的:(Linux工具 2、ls_sensors 查看Linux CPU温度)