Utility for running arbitrary commands when files change using kqueue or inotify to avoid polling.
entr is a file monitoring utility that executes arbitrary commands when files change. It uses efficient system-level file monitoring APIs (kqueue on BSD/macOS and inotify on Linux) rather than polling, making it responsive for development workflows that require rapid feedback.
The tool accepts a list of files via stdin and monitors them for changes, executing a specified command whenever modifications occur. It supports several operational modes including restarting long-running processes with the -r flag, clearing the screen before execution with -c, and terminating when a subprocess exits with -z. The -d flag enables directory monitoring to catch newly added files.
Common use cases include auto-reloading development servers, rebuilding projects on source changes, and running test suites when code is modified. The tool integrates well with standard Unix utilities - users typically pipe file lists from find or ls commands to entr. It includes workarounds for environments with incomplete inotify support like Docker for Mac and Windows Subsystem for Linux through the ENTR_INOTIFY_WORKAROUND environment variable.
# via Source
./configure && make test && make install