Currently I am monitoring the files by using above code, it works as expected. Basically I am monitoring the opened text files and executing commands.
inotifywait