mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-09-21 12:44:02 +08:00
watch: merge common and linux, add examples (#15644)
Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
This commit is contained in:
+13
-5
@@ -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: <https://manned.org/watch>.
|
||||
|
||||
- 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}}`
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
# watch
|
||||
|
||||
> Execute a command repeatedly, and monitor the output in full-screen mode.
|
||||
> More information: <https://manned.org/watch>.
|
||||
|
||||
- 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}}`
|
||||
Reference in New Issue
Block a user