watch 的基本功能是周期性执行某一命令,并将输出全屏显示。
watch [options] command
常用的指令是
-d, --differences[=cumulative] highlight changes between updates
(cumulative means highlighting is cumulative)
-h, --help print a summary of the options
-n, --interval= seconds to wait between updates
-v, --version print the version number
-t, --no-title turns off showing the header
其中,最常用的是-n, 表示多少秒刷新一次指令
监测显卡的指令为:watch -n 2 nvidia-smi, 表示2s刷新一次指令