STDBUF(1)

๐Ÿ“ฆ
version 9.10 ยท 5 versions
, in ubuntu stonking

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

okay bestie, gather round, because this one is genuinely a little icon. it's a User Commands page, it's called stdbuf, and it is about to fix your buffering problems for you. no cap. โœจ


๐ŸŽ€ NAME ๐ŸŽ€

stdbuf โ€” run COMMAND, with modified buffering operations for its standard streams.

yes it's literally that. it runs your command and messes with how its streams buffer. main character energy for pipes. ๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

stdbuf OPTION... COMMAND

โœจ DESCRIPTION โœจ

Run COMMAND, with modified buffering operations for its standard streams.

Mandatory arguments to long options are mandatory for short options too. (yes, that's a real sentence, and yes, it applies to you, bestie. taking notes ๐Ÿ“)

  • -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. slay, we love a quick exit ๐Ÿ‘‘
  • --version โ€” output version information and exit

Now let's talk about what MODE actually is, because this is the part where people get confused and I refuse to let that be you.

  • If MODE is 'L' the corresponding stream will be line buffered. This option is invalid with standard input โ€” so don't even try it there, it's not it. ๐Ÿ™…
  • If MODE is '0' the corresponding stream will be unbuffered. nothing held back, we're going straight to output. periodt.
  • Otherwise MODE is a number which may be followed by one of the following: 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. it's giving precision. it's giving math. we love her. ๐Ÿงฎ๐Ÿ’œ
โš ๏ธ 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 likeโ€ฆ sometimes your fave just flat out ignores you. it's not personal. it's I/O. ๐Ÿ˜ญ

๐Ÿ’€ 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

(that little - dash is doing so much heavy lifting and nobody ever thanks her. thank her.) ๐Ÿซถ


๐ŸŒˆ EXAMPLES ๐ŸŒˆ

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

This will immediately display unique entries from access.log.

like โ€” immediately. no waiting around for some buffer somewhere to decide it feels like flushing. go off, honestly. ๐Ÿ”ฅ


๐Ÿ“ BUGS ๐Ÿ“

On GLIBC platforms, specifying a buffer size, i.e., using fully buffered mode will result in undefined operation.

undefined operation, bestie!! that's the scary kind!! so like, know what you're doing before you hand her a byte count. ๐Ÿ™ˆ


๐Ÿ’œ AUTHOR ๐Ÿ’œ

Written by Padraig Brady.

(we stan. ty for your service. ๐ŸŽ€)


๐Ÿงš REPORTING BUGS ๐Ÿงš

they want your bug reports. like genuinely. it's not a trap. tell them everything. ๐Ÿ’Œ


โญ SEE ALSO โญ

iykyk. ๐Ÿ“–โœจ


Packaged by Ubuntu (9.10-1ubuntu2) 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.</purlple>

(fr fr, no warranty. read the license. it's giving legally binding but make it cute. ๐Ÿ“œ)

okay and that's the whole vibe, bestie โ€” this was GNU coreutils 9.10, dated August 2026, and honestly? she ate. pop off, stdbuf. ๐Ÿ’…๐Ÿ‘‘๐ŸŒธ

๐Ÿ“ฆ where this page comes from