[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tail bug when following non-existent files and skipping lines (tail -F -

From: Jon Hart
Subject: Tail bug when following non-existent files and skipping lines (tail -F -n +2)
Date: Fri, 7 Jun 2019 13:26:58 -0700

I have a file that does yet exist, but when it does finally exist I want to
skip the first line and follow the remainder of the file.  tail -F -n +2
should do this, however it does not skip the first line -- it starts
printing at the first line.

In one shell, fire up tail on a file that does not yet exist and tell it to
start printing at the second line:

$ tail -F -n +2 /tmp/does_not_exist
tail: cannot open '/tmp/does_not_exist' for reading: No such file or

In another shell, write several lines to the non-existent file:

$  echo -e "line1\nline2\nline3" > /tmp/does_not_exist

Now see that tail printed out all three lines rather than skipping the

tail: '/tmp/does_not_exist' has appeared;  following new file

tail/coreutils 8.28

I don't see anything in the help that hints at what might be happening
here.  Smells like a bug.  Can anyone else confirm?


NOTICE OF CONFIDENTIALITY: At Rapid7, the privacy of our customers, 
partners, and employees is paramount. If you received this email in error, 
please notify the sender and delete it from your inbox right away. Learn 
how Rapid7 handles privacy at 
<>. To opt-out of Rapid7 marketing 
emails, please click here 
<> or email 
address@hidden <mailto:mailto:address@hidden>.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]