fswatch
A cross-platform file change monitor. tldr-pages
On several platforms
Several platforms
Run a Bash command on file creation, update, or deletion
fswatch path/to/file | xargs --max-args 1 bash_commandIdentifyWatch one or more files and/or directories
fswatch path/to/file path/to/directory path/to/another_directory/**/*.js | xargs --max-args 1 bash_commandIdentifyPrint the absolute paths of the changed files
fswatch path/to/directory | xargs --max-args 1 -I _ echo _IdentifyFilter by event type
fswatch --event Updated path/to/directory | xargs --max-args 1 bash_commandIdentify