I am new to Linux and I am trying to grasp how pipes and buffers work. I read that if we type in the following in the terminal:
command1 | command2
the buffer will be flushed to stdout when it contains let's say 4K of data. From another post on stackoverflow How to make output of any shell command unbuffered?
I found out that one can "turn off" the buffer or change the buffer strategy to line buffering using a pseudo terminal. How does actually a pseudo terminal work in this case and why is it possible to change the buffer strategy using a pseudo terminal?
Thank you!