功能

可以将命令的输出结果输出到标准输出设备(显示器),此命令一般多用于周期性执行相关命令


选项

  • -d, --differences      高亮显示变化的区域

  • -n, --interval seconds   间隔时间

  • -t, --no-title        关闭watch命令在顶部的标题行


示例

watch -n1 -d -t ifconfig eth0


建议

一般不加 -t 选项


wKiom1gkLDfBgbP6AAB32fB5i8I889.png-wh_50


补充

centos 7 默认是没有安装mlocate的,所以无法使用updatedblocate这两个命令

yum install -y mlocate