GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
* Sign Up! *

Support
Customer Portal
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
STDBUF(1) FreeBSD General Commands Manual STDBUF(1)

stdbufchange standard streams initial buffering

stdbuf [-e bufdef] [-i bufdef] [-o bufdef] [command [...]]

stdbuf is used to change the initial buffering of standard input, standard output and/or standard error streams for command. It relies on libstdbuf(3) which is loaded and configured by stdbuf through environment variables.

The options are as follows:

bufdef
Set initial buffering of the standard error stream for command as defined by bufdef (see BUFFER DEFINITION).
bufdef
Set initial buffering of the standard input stream for command as defined by bufdef (see BUFFER DEFINITION).
bufdef
Set initial buffering of the standard output stream for command as defined by bufdef (see BUFFER DEFINITION).

Buffer definition is the same as in libstdbuf(3):

"0"
unbuffered
"L"
line buffered
"B"
fully buffered with the default buffer size
size
fully buffered with a buffer of size bytes (suffixes 'k', 'M' and 'G' are accepted)

In the following example, the stdout stream of the awk(1) command will be fully buffered by default because it does not refer to a terminal. stdbuf is used to force it to be line-buffered so vmstat(8)'s output will not stall until the full buffer fills.

# vmstat 1 | stdbuf -o L awk '$2 > 1 || $3 > 1' | cat -n

The stdbuf utility first appeared in FreeBSD 8.4.

The original idea of the stdbuf command comes from Padraig Brady who implemented it in the GNU coreutils. Jeremie Le Hen implemented it on FreeBSD.

April 28, 2012 FreeBSD 15.1-RELEASE-p1

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.