Runs arbitrary commands when files change using kqueue or inotify to avoid polling
entr is a file watching utility that executes arbitrary commands when files change. It uses kqueue(2) on BSD/macOS and inotify(7) on Linux to monitor filesystem events without polling, making it efficient for continuous monitoring scenarios.
The tool accepts file lists via stdin and can restart processes with the -r flag, clear the screen with -c, or terminate when a monitored process exits using -z. It supports running shell commands with -s and can be configured to monitor directory additions with -d. entr handles common development workflows like auto-reloading servers, rebuilding projects on source changes, and running tests when files are modified.
Developers use entr for rapid feedback loops during development, such as automatically rebuilding projects when source files change, restarting Node.js servers, or re-running database queries when SQL files are updated. The utility 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