Forrest logo
tool overview
On this page you find all important commands for the CLI tool stdbuf. If the command you are looking for is missing please ask our AI.

stdbuf

stdbuf is a command-line tool in Linux and Unix-like operating systems. It stands for "standard buffering" and is designed to control the buffering operations of the standard streams, i.e., input, output, and error. It is often used to modify the behavior of certain commands by altering their default buffering settings.

stdbuf provides three different buffering modes: zero, line, and full. The zero mode turns off buffering completely, making input and output operations unbuffered. The line mode enables line buffering, where output is displayed when a newline character is encountered or the buffer is full. The full mode uses the system default buffering behavior for the streams.

The tool is primarily used to fix buffering issues that may arise when combined with other commands or scripts. By setting specific buffering modes, it ensures that the desired output is immediately displayed or that the input is read and processed correctly.

stdbuf is often employed in scripting and piping scenarios, where data transfer between different programs needs to be synchronized or properly managed. It can be particularly helpful when running programs that produce large amounts of output, ensuring that the output is displayed promptly rather than waiting for the buffer to fill up.

This command is typically used by appending it before another command in the command line. For example, to run the command "command_name" with line buffering, you would enter "stdbuf -oL command_name" in the terminal.

stdbuf is a versatile and handy tool for controlling buffering operations, providing flexibility and control over how data is processed and displayed in the command line environment.

List of commands for stdbuf:

  • stdbuf:tldr:7eb0c stdbuf: Change the standard error buffer to unbuffered.
    $ stdbuf --error=${0} ${command}
    try on your machine
    explain this command
  • stdbuf:tldr:83b73 stdbuf: Change the standard input buffer size to 512 KiB.
    $ stdbuf --input=${512K} ${command}
    try on your machine
    explain this command
  • stdbuf:tldr:b7cd8 stdbuf: Change the standard output buffer to line-buffered.
    $ stdbuf --output=${L} ${command}
    try on your machine
    explain this command
tool overview