STDBUF(1)

๐Ÿ’– STDBUF(1) โ€” like, the manual page but make it slay ๐Ÿ’–

okay bestie, gather round, because this one is genuinely iconic. it's stdbuf, a User Command, and it's about to fix your buffering problems. yes, buffering. stay with me. ๐Ÿฆ‹


โœจ NAME โœจ

stdbuf โ€” run COMMAND, with modified buffering operations for its standard streams. no cap, that's the whole gig. ๐Ÿ‘‘


๐ŸŒธ SYNOPSIS ๐ŸŒธ

stdbuf OPTION... COMMAND

๐Ÿ’… DESCRIPTION ๐Ÿ’…

so basically: you run COMMAND, except its standard streams get their buffering ops modified. that's it. that's the tea. โ˜•

mandatory arguments to long options are mandatory for short options too โ€” yeah, the rules apply both ways, fr fr.

  • -i, --input=MODE โ€” adjust standard input stream buffering ๐Ÿซถ
  • -o, --output=MODE โ€” adjust standard output stream buffering โœจ
  • -e, --error=MODE โ€” adjust standard error stream buffering ๐Ÿ˜ญ
  • --help โ€” display this help and exit. short king behavior. ๐Ÿ‘‘
  • --version โ€” output version information and exit. ๐Ÿ’ซ

๐ŸŽ€ what even is MODE ๐ŸŽ€

okay this is the part everyone skips and then gets confused, so like, don't skip it bestie.

  • if MODE is 'L', the corresponding stream will be line buffered. ๐Ÿงš but โ€” and this is important โ€” this option is invalid with standard input. not allowed. don't try it.
  • if MODE is '0', the corresponding stream will be unbuffered. zero thoughts, just output. ๐Ÿ’€
  • otherwise, MODE is a number, and it may be followed by one of these little suffix cuties:
    • KB = 1000
    • K = 1024
    • MB = 1000*1000
    • M = 1024*1024
    • and so on for G, T, P, E, Z, Y, R, Q.

binary prefixes can be used too: KiB=K, MiB=M, and so on. ๐ŸŒˆ in this case the corresponding stream will be fully buffered, with the buffer size set to MODE bytes.

NOTE: if COMMAND adjusts the buffering of its standard streams (tee does, for example) then that will override corresponding changes by stdbuf. also some filters (like dd and cat etc.) don't use streams for I/O, and are thus unaffected by stdbuf settings. so if it's not working, it might lowkey be their fault, not yours. ๐Ÿ™ˆ

๐Ÿซถ Exit status: ๐Ÿซถ

  • 125 โ€” if the stdbuf command itself fails ๐Ÿ˜ญ
  • 126 โ€” if COMMAND is found but cannot be invoked ๐Ÿ’€
  • 127 โ€” if COMMAND cannot be found ๐Ÿ•ต๏ธ
  • - โ€” the exit status of COMMAND otherwise โœจ

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

tail -f access.log | stdbuf -oL cut -d ' ' -f1 | uniq

this will immediately display unique entries from access.log. iconic pipeline behavior, honestly. this is the one you came here for. ๐Ÿ”ฅ


๐Ÿ’€ BUGS ๐Ÿ’€

on GLIBC platforms, specifying a buffer size โ€” i.e., using fully buffered mode โ€” will result in undefined operation. not "maybe weird", not "probably fine". undefined. so like, be careful bestie, that's genuinely not a vibe. ๐Ÿ˜ญ


๐ŸŒธ AUTHOR ๐ŸŒธ

written by Padraig Brady. king behavior. ๐Ÿ‘‘


๐ŸŽ€ REPORTING BUGS ๐ŸŽ€


copyright ยฉ 2026 Free Software Foundation, Inc. license GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

this is free software: you are free to change and redistribute it. there is NO WARRANTY, to the extent permitted by law. (yes the all-caps is theirs, it's giving legal drama and honestly? deserved.) ๐Ÿ’…


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹


so yeah, that's the whole page. this is <strong>GNU coreutils 9.12</strong>, dated <strong>September 2026</strong> โ€” the era-defining release, if you will. go forth and unbuffer your streams, bestie. you ate. periodt. ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from