Harikrishnan Harikrishnan - 15 days ago 6
Linux Question

How to show only newly logged content in tail -f?

normally tail -f shows 10-15 already logged content.How can I avoid it? I only want to see newly logged content.Is there any switch in tail for that.Please advice.

Answer

Simply set to return zero lines:

tail -n 0 -f /var/log/syslog

man tail:

   -n, --lines=K
          output the last K lines, instead of the last 10; or use -n +K to output lines starting with the Kth