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
run1
run1
run1
tail: mylog.log: file truncated
run2
run2
run2
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?