Log files that get extended at the tail can be read live using
tail -f command
Is there anyway to do the same with a log that gets appended at the beginning?
The man page for
head doesn't help.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Well you can't "append at the beginning" of a file. The only way to achieve that affect would be to rewrite the whole file, but short of doing a text match
head would have no way of knowing what had happened.
It's easy for
tail as it just keeps track of the position it read up to and then keeps trying to read more bytes beyond that position.