Here is a simple command for you. It uses inotify tools. So first you need to install :
sudo yum install inotify-tools and then you can try something like this:
while true; do inotifywait -r -e modify --exclude=".swp" . && make; done Here, once the file changes, we are running make, but you can do anything you want.
Related articles Development Server: Automatic Reload on Code Change Concurrent or lock access in bash script function