watch可以幫你監測一個命令的運行結果,來監測你想要的一切命令的結果變化
watch -n 1 -d "命令" 每隔一秒高亮顯示后面命令的變化
watch -d 'ls -l'
# 每隔一秒高亮顯示當前目錄變化
Usage:
watch [options] command
Options:
-b, --beep beep if command has a non-zero exit
-c, --color interpret ANSI color and style sequences
-d, --differences[=<permanent>]
highlight changes between updates
-e, --errexit exit if command has a non-zero exit
-g, --chgexit exit when output from command changes
-n, --interval <secs> seconds to wait between updates
-p, --precise attempt run command in precise intervals
-t, --no-title turn off header
-x, --exec pass command to exec instead of "sh -c"
-h, --help display this help and exit
-v, --version output version information and exit
