What is the efficient way to implement tail in *NIX? I came up (wrote) with two simple solution, both using kind of circular buffer to load lines into circular structure (ar
Read backwards from the end of the file until N linebreaks are read or the beginning of the file is reached.
N
Then print what was just read.
I dont think any fancy datastructures are needed here.
Here is the source code of tail if you're interested.