Take the tour ×  Using tail -F to follow a file that might not
exist yet, and it works across truncations, as follows:  tail:
cannot open `mylog.log' for reading: No such file or directory
tail: `mylog.log' has appeared;  following end of new file tail:
mylog.log: file truncated  I only want to see the current run's
output, as multiple runs fit in a screen and it's hard to tell
where one stops and the next begins. Before executing a run, I
find myself using  rm mylog.log; clear && tail -F mylog.log  But
I have to remember to do that before every run. I realize that
if tail would clear the screen when truncation occurs, it would
give me exactly the behavior that I want without requiring any
interaction from me.  The tail man page didn't seem to indicate
this was possible. I'm sure I can't be the first to desire this
behavior, has anyone else used other means to accomplish it?
share|improve this question add comment  1 Answer  up vote 3
down vote accepted  This snippet will work:  tail -F $LOGFILE
2>&1 | sed -