Skip to content
A small tool for acting on file changes
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A small utility for acting on file changes

usage: watch [-h] -f FILE [FILE ...] -c CMD [-i INTERVAL] [-a] [-v]

Run a command when a file changes.

optional arguments:
  -h, --help            show this help message and exit
  -f FILE [FILE ...], --file FILE [FILE ...]
                        The file(s) or directories to watch.
  -c CMD, --cmd CMD     The command to run when the file(s) changes. 
                        This should be a quoted string.
  -i INTERVAL, --interval INTERVAL
                        The interval to check the file(s) at, in seconds.
  -a, --absolute        Guess the absolute paths of the files being watched.
  -v, --verbose         Output file names and commands as they are run.

    watch --file --cmd "pandoc -o readme.html"

    watch -f somelog.txt -c "cat somelog.txt"

    watch --file *.c *.h --cmd "make"

    watch -f ./experiments --cmd "echo experiment done!"

To Install:

sudo python install

This installs it as, as to not conflict with any other commands named watch.

To create a windows exe:

python py2exe

Exe built with py2exe downloaded from here.

Watch is released under the MIT License.

Copyright (C) 2012 Peter Swire

You can’t perform that action at this time.