diff --git a/pages/common/watch.md b/pages/common/watch.md index 0aad04cb1e..803af70cc5 100644 --- a/pages/common/watch.md +++ b/pages/common/watch.md @@ -1,6 +1,6 @@ # watch -> Execute a program periodically, showing output fullscreen. +> Execute a program periodically and monitor the output in full-screen mode. > More information: . - Repeatedly run a command and show the result: @@ -9,12 +9,20 @@ - Re-run a command every 60 seconds: -`watch -n {{60}} {{command}}` +`watch --interval {{60}} {{command}}` -- Monitor the contents of a directory, highlighting differences as they appear: +- Monitor disk space, highlighting differences as they appear: -`watch -d {{ls -l}}` +`watch --differences {{df}}` - Repeatedly run a pipeline and show the result: -`watch '{{command_1}} | {{command_2}} | {{command_3}}'` +`watch "{{command_1}} | {{command_2}} | {{command_3}}"` + +- Exit `watch` if the visible output changes: + +`watch --chgexit {{lsblk}}` + +- Interpret terminal control characters: + +`watch --color {{ls --color=always}}` diff --git a/pages/linux/watch.md b/pages/linux/watch.md deleted file mode 100644 index 63e767157d..0000000000 --- a/pages/linux/watch.md +++ /dev/null @@ -1,20 +0,0 @@ -# watch - -> Execute a command repeatedly, and monitor the output in full-screen mode. -> More information: . - -- Monitor files in the current directory: - -`watch {{ls}}` - -- Monitor disk space and highlight the changes: - -`watch -d {{df}}` - -- Monitor "node" processes, refreshing every 3 seconds: - -`watch -n {{3}} "{{ps aux | grep node}}"` - -- Monitor disk space and if it changes, stop monitoring: - -`watch -g {{df}}`