Doing an inotifywait
to watch a directory, and trying to exclude all subdirectories from being watched while not excluding the files.
inotifywait -r -q --exclude <pattern> dir/
What to put in <pattern>
? Manual for inotifywait
specifies:
--exclude <pattern>
Do not process any events whose filename matches the specified POSIX extended regular expression, case sensitive.
There's no -type
flag like in find
. I've tried (^/)
but that seems to exclude everything.
Help appreciated.