Search code examples
linuxunixcommandtail

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 the tail command for that? Please advice.


Solution

  • 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