paperlined.org
rosetta_stone > os
document updated 3 days ago, on Feb 17, 2025

how to disable line-buffering for various Linux/Unix commands

Many text-based commands will use block buffering with their output. This makes it efficient to process very large text files, but it can cause serious lag/"stuttering" when interactively watching the output of a pipeline of commands.

grep --line-buffered

perl -e '$|=1;   <your code goes here>'

awk '{ print $0; fflush(stdout) }'

sed -u

tailtail never uses line buffering

tee — I'm not sure? There's lots of discussion here.

Add-on programs that sometimes work: