Add note about entr
This commit is contained in:
parent
dc23129cae
commit
6554e5e02e
1 changed files with 22 additions and 0 deletions
22
notebook/Linux/Tools/entr.md
Normal file
22
notebook/Linux/Tools/entr.md
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
---
|
||||||
|
tags: automation
|
||||||
|
---
|
||||||
|
# entr
|
||||||
|
Runs a command when files change:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
find -type f -name '*.c' | entr make
|
||||||
|
```
|
||||||
|
|
||||||
|
Use `-s` to interpret the first argument as a shell command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
find -type f | entr -s "clear && ls"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Services
|
||||||
|
Use `-r` to monitor and automatically restart services:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
find -name "*.lua" | entr -r lua server.lua
|
||||||
|
```
|
Loading…
Reference in a new issue