mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 06:42:10 +02:00
inotify-wait: add page (#2676)
This commit is contained in:
parent
cc5619f0d0
commit
07d6ef9abc
1 changed files with 27 additions and 0 deletions
27
pages/linux/inotify-wait.md
Normal file
27
pages/linux/inotify-wait.md
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# inotifywait
|
||||||
|
|
||||||
|
> Waits for changes to one or more files.
|
||||||
|
|
||||||
|
- Run a command when a file changes:
|
||||||
|
|
||||||
|
`while inotifywait {{path/to/file}}; do {{command}}; done`
|
||||||
|
|
||||||
|
- Be quiet about watching for changes:
|
||||||
|
|
||||||
|
`while inotifywait --quiet {{path/to/file}}; do {{command}}; done`
|
||||||
|
|
||||||
|
- Watch a directory recursively for changes:
|
||||||
|
|
||||||
|
`while inotifywait --recursive {{path/to/directory}}; do {{command}}; done`
|
||||||
|
|
||||||
|
- Exclude files matching a regular expression:
|
||||||
|
|
||||||
|
`while inotifywait --recursive {{path/to/directory}} --exlude '{{regex}}'; do {{command}}; done`
|
||||||
|
|
||||||
|
- Wait at most 30 seconds:
|
||||||
|
|
||||||
|
`while inotifywait --timeout {{30}} {{path/to/file}}; do {{command}}; done`
|
||||||
|
|
||||||
|
- Only watch for file modification events:
|
||||||
|
|
||||||
|
`while inotifywait --event {{modify}} {{path/to/file}}; do {{command}}; done`
|
Loading…
Add table
Reference in a new issue