Celeb Glow
updates | March 27, 2026

inotifywait not detecting links

I have successfully created a watcher for modifications inside a directory, recursively:

inotifywait -m -r -e modify --format '%w%f' "$Path" | while read File
do echo "File $File is modified"
done

However, I have some symbolic links inside that directory. And when I open them in an editor and change them, inotifywait does not print anything.

I think it's because the actual files are in another directory.

How can I tell inotifywait to detect changes of links too?

1 Answer

You can't. inotifywait watches the symbolic links themselves, not the files they point to.

Behind the scenes inotifywait uses the inotify syscall with the IN_DONT_FOLLOW flag, which causes this behaviour. If you want to change that you would need to write your own inotifywait, without the flag.

I got this from this discussion.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy