I'm using inotifytools to monitor a directory recursively. when I use the following command
inotifywait ./test -m
after the command, if I create a director under ./test
, assuming ./test/test2
. Then if I do something under test2
, for example, delete a file, or add a file, it's very strange that there was no event occurred.
It seems that there is no watch on test2
.
Is that a bug or I just use in the wrong way?
man 1 inotifywait
, you will get the following output:By default,
inotifywait
won't monitor subdirectories, so you need-r, --recursive
option to force that. So the command you need will be like this: