树莓派查看CPU和GPU温度,添加 ./temp.sh 命令

树莓派查看CPU和GPU温度

#!/bin/bash - 
# =========================================
#          脚本名FILE: temp.sh
# 
#         命令: ./temp.sh 
# 
#   DESCRIPTION: 树莓派查看CPU和GPU温度
# 
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: joyist(), http://chdong.top
#  ORGANIZATION: joyist
#       CREATED: 03/09/2018 01:40:25 PM
#      REVISION:  ---
#=============================================

cat /sys/class/thermal/thermal_zone0/temp | awk '{print "CPU Temp:"(int($0) / 1000)}'
vcgencmd measure_temp | cut -c6-9 | awk '{print "GPU Temp:"$0}'

加执行权限 : chmod +x info.py

运行 ./temp.sh 

如果报错,修改最后一行如下

/opt/vc/bin/vcgencmd measure_temp | cut -c6-9 | awk '{print "GPU Temp:"$0}'

 

你可能感兴趣的:(树莓派查看CPU和GPU温度,添加 ./temp.sh 命令)