1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-09-10 16:33:46 +02:00

watch: merge common and linux, add examples (#15644)

Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
This commit is contained in:
Managor 2025-02-06 14:15:36 +02:00 committed by GitHub
parent f8a87f0d68
commit 745d8aebd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 25 deletions

View file

@ -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}}`

View file

@ -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}}`