Linux watch命令详解(转载)
1. 基础命令 watch可以帮你监测一个命令的运行结果,来监测你想要的一切命令的结果变化 常见命令参数
1 2 3 4 5 6 7 |
Usage: watch [-dhntv] [--differences[=cumulative]] [--help] [--interval=<n>] [--no-title] [--version] <command> -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 |
2. 常见命令展示 2.1. 每隔一秒高亮显示网络链接数的变化情况
1 2 3 |
watch -n 1 -d netstat -ant 【-n 设置间隔,-d,difference,高亮显示不同】 watch -d 'ls /home/omd' 【-d 高亮显示】 watch -t 'ls /home/omd' 【-t会关闭watch命令在顶部的时间间隔】 |
说明: 切换终端: Ct… 阅读更多 »Linux watch命令详解(转载)