12

How to monitor only the last n lines of a log file?

view full story
linux-howto

http://unix.stackexchange.com – I have growing log file for which I want to display only the last 15 lines. Here is what I know I can do: tail -n 15 -F mylogfile.txt As the log file is filled, tail appends the last lines to the display. I am looking for a solution that only displays the last 15 lines and get rid of the lines before the last 15 after it has been updated. Would you have an idea? Thank you! (HowTos)