How do you run command every time a file is modified?



How do you run command every time a file is modified?..

Answer / Manoj Kumar Kaushal

Use the 'inotifywait' or 'incron' commands to trigger a script whenever a file is modified. Here is an example using inotifywait:n`n while true ; do inotifywait -e modify path/to/your/file ; sh /path/to/script.sh ; donen`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Linux Commands Interview Questions

What is pwd in linux command?

1 Answers  


what is a command to display top 10 users who are using Huge Space?

3 Answers   IBM, TNS,


What does chmod 777 do?

1 Answers  


How do you view the contents of a file in Linux?

1 Answers  


What is the most graceful way to get to run level single user mode?

9 Answers   Cisco,


What is ll command in unix?

1 Answers  


What is Data Command?

1 Answers  


What is the use of ls command?

1 Answers  


what is the difference between RHEL4 & RHEL5?

3 Answers   TCS,


i dont know root password then this situation can we change or break root password to ant process

5 Answers  


What is help command in linux?

1 Answers  


hi friends how to reinstall the grub.conf file. once i delete the grub file in perminatle ofter how to get back that file. plz send me ans. regards. madhu.m

5 Answers  


Categories