Linux – tail command not updating output for debug files

commanddebugdebugginglinuxtail

I know that tail -f /var/log/messages will be keep updating on screen as the contents of file gets updated.
But when I tried the same thing with a debug file system's file it is not working , any idea?

I tried ftrace and tried this: tail -f trace it is not working ?

Note, I can see the contents actually getting by using watch -n1 cat trace.

Best Answer

tail -f works on the file descriptor, not on the file name. If the file is being overwritten, or deleted and re-created, tail -f won't be able to track that.

In gnu tail there's the option --follow=name or -F which will track the file name rather than the inode/file descriptor.

Related Topic