here is an example buffer.c showing this behaviour with make buffer && ./buffer | tee /dev/null #include <stdio.h> void main() { printf("line1\n"); sleep(1); printf("line2\n"); }