0

1 How to process from start of a continuously updating file( 1 --> infinite) ? 2 tail -f / tail -n10 -f solution is not correct, because it processing the file from end or some n lines form end of file. But i need to process the file from start of file to forever(continuous).

  • Thank you, it solved my problem; putting more number of lines than file contains (100000 > myfile size) solves my problem. – sasi kiran Dec 08 '15 at 06:06

1 Answers1

2

From tail --help:

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

So,

tail -f -n +1
Kenney
  • 9,003
  • 15
  • 21
  • Thank you for replay, But i need out put from the first line of the file; Reference from start not from the end of file; say some 10 lines from start to continuous monitoring. – sasi kiran Dec 08 '15 at 03:23
  • That's what the `-n +1` means: start at the first line. If you were to write `-n 1` it would be 1 lines from the end. Note the `+`. – Kenney Dec 08 '15 at 13:41
  • Thank you, i missed the simple thing, and wasted many days for searching. – sasi kiran Dec 09 '15 at 05:56