Tail has the following options:
-f The -f option causes tail to not stop when end of file is reached, but rather to wait for additional data to be appended to the
input. The -f option is ignored if the standard input is a pipe, but not if it is a FIFO.
I'd like to only grep for something
in the tail output.
tail -f <FILE> | grep <SOMETHING>
Issue is it only run grep once and is done. No other output happens. How can I make grep run correctly with the -f
?
You will find another SO Question helpful: How to 'grep' a continuous stream?
Turn on grep's line buffering mode.
tail -f file | grep --line-buffered my_pattern