Harikrishnan
Harikrishnan

Reputation: 9979

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.

Upvotes: 4

Views: 633

Answers (1)

pylover
pylover

Reputation: 8065

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

Upvotes: 4

Related Questions