Chinaunix首页 | 论坛 | 博客
  • 博客访问: 140656
  • 博文数量: 68
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 720
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-28 20:01
文章分类

全部博文(68)

文章存档

2015年(68)

我的朋友

分类: 系统运维

2015-08-31 17:27:52

inux的watch命令是一个很好用的东西,通过它我们可以监视命令不断变化的运行结果,它会周期性的执行某个命令并全屏输出,可以使用ctrl+c退出,默认是每两秒监视并输出一次

例: watch -n 1 cat /proc/uptime  监视系统的运行时间

watch命令选项说明:


-d, --differences[=cumulative]        highlight changes between updates

                (cumulative means highlighting is cumulative)

  -h, --help                            print a summary of the options
 -n, --interval=<seconds>              seconds to wait between updates

 -v, --version                         print the version number

  -t, --no-title                        turns off showing the header

1.-n 修改刷新频率,单位为秒

例:watch -n 10 cat /proc/uptime 10秒一次输出系统的运行时间

2.-d 高亮显示屏幕两次刷新之间的差异

例:watch -d cat /proc/uptime 10秒一次输出系统的运行时间

阅读(249) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~