How do I examine the tail of a growing file on WSL-2

Viewed 411

On WSL tail -f file reports once and then does nothing even though the file is growing.

Is there a workaround short of writing my own?

2 Answers

Use:

tail  -f ---disable-inotify file

Note the 3 hyphens before "disable..." This parameter makes tail to use polling to detect file changes and know when to read more data, which is inefficient but works anywhere. By default tail uses inotify, even on filesystems without inotify support like Windows NTFS.

Some more information about this story at https://github.com/microsoft/WSL/issues/925

Not sure why tail isn't properly updating but one workaround is that you can less the file then press shift+g to refresh it.

Related