entr: Usage, Options & Common CI Errors
entr runs an arbitrary command whenever files listed on stdin change.
entr is the minimalist file-watcher: pipe a list of files into it and it re-runs your command on change. Like all watchers it must not be left running in a pipeline, and it has a specific stdin contract.
What it does
entr reads a list of filenames from stdin (typically from find or ls) and executes a command each time any of those files change. It is tiny, dependency-free, and a common BSD/Linux dev-loop primitive.
Common usage
ls *.c | entr make
find src -name '*.go' | entr -r go run .
echo file.md | entr -c pandoc file.md -o out.html
find . -name '*.py' | entr -d pytest # -d: exit if a dir changes
ls *.js | entr -p eslint /_ # /_ = the changed fileOptions
| Flag | What it does |
|---|---|
| -r | Reload: restart a persistent process on change |
| -c | Clear the screen before each run |
| -d | Track directories; exit if a new file appears |
| -p | Postpone: do not run until the first change |
| -s | Evaluate the command via the shell |
| /_ | Placeholder for the file that changed |
Common errors in CI
"entr: No regular files to watch" means stdin was empty - the find/ls produced nothing (wrong glob or path). entr requires actual files on stdin; piping a directory name will not work. Like watchexec, entr blocks and waits for changes, so it hangs a CI step until timeout. It belongs in local dev, not pipelines. On Linux it can hit the inotify watch limit with large trees ("inotify_add_watch ... No space left on device"); raise fs.inotify.max_user_watches.