One - One Code All

Blog Content

linux循环执行某条命令

Linux-Mac   2008-07-09 23:05:02

 watch -n 2 cmd : 监视刷新执行,watch命令的常用参数有“-n”、“-d”、“-t”分别表示“时隔多少秒刷新”、“高亮显示动态变化”、“关闭命令顶部的时间间隔,命令显示”

eg. 查看gpu性能 每俩秒执行一次: watch -n 2 nvidia-smi
eg. 每两秒查看一次内存:watch -n 2 free -m

退出 “Ctrl + C”


上一篇:Linux下如何查看文件md5值
下一篇:linux系统查看当前正在运行的服务

The minute you think of giving up, think of the reason why you held on so long.