# entr

> Runs arbitrary commands when files change using kqueue or inotify to avoid polling

Stars: 5.7k · Language: C · License: ISC · Categories: Dev Tools

- Repository: https://github.com/eradman/entr
- Website: http://eradman.com/entrproject/
- Page: https://www.trmn.sh/tools/entr

## Install

- Source: `./configure && make test && make install`

## Overview

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.

### Installation

```bash
# via Source
./configure && make test && make install
```

## Alternatives

- [Chafa](https://www.trmn.sh/tools/chafa.md): Command-line utility that converts images and animated GIFs into ANSI/Unicode character art or terminal graphics formats, built on a C library. (C, 5.4k stars)
- [radare2](https://www.trmn.sh/tools/radare2.md): Command-line reverse engineering framework for disassembling, analyzing, emulating, debugging and patching binaries across many architectures and file formats. (C, 25.3k stars)
- [FFmpeg](https://www.trmn.sh/tools/ffmpeg.md): Collection of libraries and command-line tools (ffmpeg, ffplay, ffprobe) for converting, streaming, playing and inspecting audio, video and subtitles. (C, 66.3k stars)
- [Docker CLI](https://www.trmn.sh/tools/docker-cli.md): Source repository for the Docker command-line client, written in Go and built with docker buildx bake, with cross-platform and glibc/musl build targets. (Go, 6.1k stars)
- [Bats-core](https://www.trmn.sh/tools/bats-core.md): TAP-compliant testing framework for Bash 3.2+ that runs test cases written as Bash functions to verify Bash scripts and other UNIX programs. (Shell, 6.3k stars)

## Guides

- [watchexec vs entr](https://www.trmn.sh/compare/watchexec-vs-entr): Compare watchexec, entr: workflows, strengths and tradeoffs.

---

Canonical: https://www.trmn.sh/tools/entr
