views:

25

answers:

1

If i have file for eg: a log file created by any background process on unix, how do i view the data that getting updated each and every time.

i know that i can use tail command to see the file.but let's say i have used tail -10 file.txt it will give the last 10 lines.but if lets say at one time 10 lines got added and at the next instance it has been added 2 lines. now from the tail command i can see previous 8 lines also.i don't want this.i want only those two lines which were added.

In short i want to view only those lines which were appended.how can i do this?

+2  A: 

tail -f file.txt

That always outputs the last added lines immediately.

Ernelli