watch 能间歇地执行程序,并将输出结果以全屏的方式显示,默认时2s执行一次;

watch -n 5 ping -c 1 www.baidu.com # 进行循环5秒钟,发送一次ping包;

使用范例:

To watch for mail, you might do

              watch -n 60 from

       To watch the contents of a directory change, you could use

              watch -d ls -l

       If you're only interested in files owned by user joe, you might use

              watch -d 'ls -l | fgrep joe'

       To see the effects of quoting, try these out

              watch echo $$
              watch echo '$$'
              watch echo "'"'$$'"'"

更多文档,请直接查找man手册;非常好用的工具,我今天才知道。。

保持更新,更多内容请关注 cnblogs.com/xuyaowen;

相关文章:

  • 2021-06-18
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-25
  • 2023-01-03
  • 2021-06-23
  • 2022-02-11
  • 2022-12-23
  • 2021-08-14
相关资源
相似解决方案