I am polling a csv file and want to capture the the last 5 lines of the file periodically. Is there a way to do that while skipping the last line. For example
File I'm Polling:
Fooo1,bar1,bar1
Fooo2,bar2,bar2
Fooo3,bar3,bar3
Fooo4,bar4,bar4
Fooo5,bar5,bar5
Fooo6,bar6,bar6
Fooo7,bar7,bar7
Tail command would capture lines 2-6 only.
The problem is that the file keeps growing.