detect file change linux code example
Example 1: linux change file name
mv oldfile.txt newfile.txt
Example 2: linux bash do something when file changes
while inotifywait -e close_write myfile.py; do ./myfile.py; done
mv oldfile.txt newfile.txt
while inotifywait -e close_write myfile.py; do ./myfile.py; done