Fancy tail -F
This is slightly embarrassing, but I've learned just recently that tail
command has -F
option. It's a CAPITAL F, not commonly used lower case -f
.
It's not POSIX standardized, but many implementations have it. GNU coreutils is an example closest to my daily usage, but I can see that (apparently similar) implementations are present in e.g. FreeBSD, NetBSD or Busybox (here behind a compile time flag called IF_FEATURE_FANCY_TAIL).
Given contents of related manuals, exact details of behavior may differ, but most, if not all, share this property as described by man from coreutils: "keep trying to open a file if it is inaccessible" (and otherwise behave as -f
).
This is really convenient. For example when working with some process that we continue to start, stop, cleanup, and then start again. I don't know how many times this included me going back to a window with tail, just to restart it, to again track a new instance of some file written to.
Another use case would be tracking rotated log file over a longer period of time.
Anyway, I've just become lucky 10000.