Entr
Cross platform way to run arbitrary commands when files change.
Usage
echo "filenames" | entr commandExample:
touch /tmp/file.txt
find /tmp -type f -name "*.txt" | entr -p echo 'Captain! Look!'
# in another terminal...
echo "That's got to be the best pirate I've ever seen" >> /tmp/file.txtFor commands that uses builtins, pipes or output redirection that needs to run in a shell, there's a -s flag that uses the default system shell:
find /tmp -type f -name "*.txt" | entr -s "echo 'Captain! Look!' | rev"It also watch changes recursively if a directory is provided!
echo "dir/to/watch" | entr -R echo 'Do something'Compilation
cargo build --releaseArch Linux installation
makepkg -sif