From 6554e5e02edb6db7ecbed26c22bb1dea90aeddbb Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Mon, 30 May 2022 15:19:33 +0200 Subject: [PATCH] Add note about entr --- notebook/Linux/Tools/entr.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 notebook/Linux/Tools/entr.md diff --git a/notebook/Linux/Tools/entr.md b/notebook/Linux/Tools/entr.md new file mode 100644 index 0000000..b0c700d --- /dev/null +++ b/notebook/Linux/Tools/entr.md @@ -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 +``` \ No newline at end of file