深度阅读

The way to keep `watch` running indefinitely until it's stopped manually?

作者
作者
2023年08月22日
更新时间
6.0 分钟
阅读时间
0
阅读量

To keep watch running indefinitely until it’s stopped manually, you can use the -n flag followed by a large number to make watch repeat the command at a sufficiently long interval. For example:

watch -n 9999 command

This will repeat the command every 9999 seconds, effectively making watch continue to run until stopped manually.

Note that there is no way to set watch to run indefinitely by default, as it is designed to run a specific number of times and then stop. However, using a large number with the -n flag as shown above can effectively achieve the same result.

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。