效果图
脚本
vi auto.sh (chmod +x ./auto.sh)
#!/bin/bash
# 按照日期创建一个文件或目录 https://blog.csdn.net/shoajun_5243/article/details/83539069
datetime=`date +%Y%m%d-%H%M%S |cut -b1-20`
dirpath=/systemMonitor/$datetime
file1=$dirpath/sensors.log
file2=$dirpath/top.log
#首先判断目录是否存在,如果不存在则创建,存在则不再创建
if [ ! -d "${dirpath}" ]
then
mkdir -p $dirpath
fi
sensors > $file1
top -n 1 > $file2
echo "完成 - ${datetime}"
前提
Ubuntu 系统实时查看CPU温度和GPU温度
Ubuntu 系统实时查看CPU温度和GPU温度_ubuntu sensors-CSDN博客文章浏览阅读1.1w次,点赞11次,收藏43次。文章介绍了在Ubuntu系统中查看CPU和GPU温度的两种方法。第一种是使用lm-sensors工具,通过命令`watch-n1sensors`实时查看,其中Core表示CPU核心,high和crit分别代表警告和临界温度。第二种方法是安装psensor应用,提供图形化的温度监控界面。https://blog.csdn.net/qq_39779233/article/details/129600514
ending...