Unbuffer
• 114 words • 1 min • updated
⚠️ This post is over one year old. It may no longer be up to date or relevant. Opinions may have changed.
The unbuffer binary comes from the expect package.
I didn’t realize until now that it is hosted in NIST.gov!
There are two scenarios in which I find unbuffer quite helpful:
- flush stdout line output immediately, in programs such as
tailorpython. Julia Evans noted this in a blog post:
shell
% tail -f /some/log/file | unbuffer grep thing1 | grep thing2Without unbuffer there’s no guarantee tail would print its stdout output in
real time.
- force stdout to write to a TTY (or to pretend that it will write to a TTY):
shell
% unbuffer ls --color=auto | less -RIn this example, less will properly recognize and display color output from
ls.
Backlinks
- new script: uwatch (Jan 10, 2026)
- watch with --color (May 24, 2025)