1 Answer
1

When using non-interactively, most standard commands, include grep, buffer the output, meaning it does not write data immediately to stdout. It collects large amount of data (depend on OS, in Linux, often 4096 bytes) before writing.

In your command, grep's output is piped to stdin of sed command, so grep buffer its output.

So, --line-buffered option causing grep using line buffer, meaning writing output each time it saw a newline, instead of waiting to reach 4096 bytes by default. But in this case, you don't need grep at all, just use tail + sed: