2016-01-21 19:13:27 -05:00
|
|
|
# watch
|
|
|
|
|
2025-02-06 14:15:36 +02:00
|
|
|
> Execute a program periodically and monitor the output in full-screen mode.
|
2021-10-05 05:35:50 +02:00
|
|
|
> More information: <https://manned.org/watch>.
|
2016-01-21 19:13:27 -05:00
|
|
|
|
|
|
|
- Repeatedly run a command and show the result:
|
|
|
|
|
|
|
|
`watch {{command}}`
|
|
|
|
|
|
|
|
- Re-run a command every 60 seconds:
|
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`watch {{[-n|--interval]}} {{60}} {{command}}`
|
2016-01-21 19:13:27 -05:00
|
|
|
|
2025-02-06 14:15:36 +02:00
|
|
|
- Monitor disk space, highlighting differences as they appear:
|
2016-01-21 19:13:27 -05:00
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`watch {{[-d|--differences]}} {{df}}`
|
2022-06-21 13:04:26 +01:00
|
|
|
|
|
|
|
- Repeatedly run a pipeline and show the result:
|
|
|
|
|
2025-02-06 14:15:36 +02:00
|
|
|
`watch "{{command_1}} | {{command_2}} | {{command_3}}"`
|
|
|
|
|
|
|
|
- Exit `watch` if the visible output changes:
|
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`watch {{[-g|--chgexit]}} {{lsblk}}`
|
2025-02-06 14:15:36 +02:00
|
|
|
|
|
|
|
- Interpret terminal control characters:
|
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`watch {{[-c|--color]}} {{ls --color=always}}`
|