PIPESZ(1)
๐ PIPESZ(1) โ the pipesz glow-up ๐
okay bestie, welcome to pipesz, a little User Commands icon from the util-linux family. she sets and examines pipe and FIFO buffer sizes and honestly? she's giving quiet competence. no cap. ๐
โจ NAME โจ
pipesz โ set or examine pipe and FIFO buffer sizes ๐ฆ
๐ธ SYNOPSIS ๐ธ
pipesz [options] [--set size] [--] [command [argument...]]
pipesz [options] --get
๐ DESCRIPTION ๐
so here's the tea โ โ pipes and FIFOs keep an internal buffer that ferries data between the read end and the write end. sometimes that default size is just... not the vibe. this program is your girl for setting and examining the size of those buffers. โจ
the --set operation sets pipe buffer sizes. if you specify it, you must give it an explicit size. otherwise it's implied, and the size gets read from /proc/sys/fs/pipe-max-size. the kernel may adjust size as described in fcntl(2). to see the actual buffer sizes that actually got set, use the --verbose option. if neither --file nor --fd are specified, --set acts on standard output. ๐
the --set operation permits an optional command to execute after setting the pipe buffer sizes. this command is executed with the adjusted pipes. cute, right?
the --get operation outputs data in a tabular format. the first column is the name of the pipe as passed to pipesz. file descriptors are named as "fd N". the second column is the size, in bytes, of the pipe's internal buffer. the third column is the number of unread bytes currently in the pipe. the columns are separated by tabs ('\t', ASCII 09h). if --verbose is specified, a descriptive header is also emitted. if neither --file nor --fd are specified, --get acts on standard input. ๐
unless the --check option is specified, pipesz does not exit if it encounters an error while manipulating a file or file descriptor. this allows pipesz to be used generically without fear of disrupting the execution of pipelines should the type of certain files be later changed. for minimal disruption, the --quiet option prevents warnings from being emitted in these cases. ๐ซถ
the kernel imposes limits on the amount of pipe buffer space unprivileged processes can use, though see BUGS below ๐. the kernel will also refuse to shrink a pipe buffer if this would cause a loss of buffered data. see pipe(7) for additional details.
pipesz supports specifying multiple short options consecutively, in the usual getopt(3) fashion. the first non-option argument is interpreted as command. if command might begin with '-', use '--' to separate it from arguments to pipesz. in shell scripts, it is good practice to use '--' when parameter expansion is involved. pipesz itself does not read from standard input and does not write to standard output unless --get, --help, or --version are specified. ๐ (yes, really, she's polite like that)
๐ OPTIONS ๐
-g,--getโ report the size of pipe buffers to standard output and exit. as a special behavior, if neither--filenor--fdare specified, standard input is examined. it is an error to specify this option in combination with--set. ๐ฆ-s,--setsize โ set the size of the pipe buffers, in bytes. this option may be suffixed byK,M,G,KiB,MiB, orGiBto indicate multiples of 1024. fractional values are supported in this case. additional suffixes are supported but are unlikely to be useful. if this option is not specified, a default value is used, as described above. if this option is specified multiple times, a warning is emitted and only the last-specified size is used. as a special behavior, if neither--filenor--fdare specified, standard output is adjusted. it is an error to specify this option in combination with--get. ๐ฅ-f,--filepath โ set the buffer size of the FIFO or pipe at path, relative to the current working directory. you may specify this option multiple times to affect different files, and you may do so in combination with--fd. generally, this option is used with FIFOs, but it will also operate on anonymous pipes such as those found in/proc/PID/fd. changes to the buffer size of FIFOs are not preserved across system restarts. ๐ญ-n,--fdnumber โ set the buffer size of the pipe or FIFO corresponding to file descriptor number. you may specify this option multiple times to affect different file descriptors, and you may do so in combination with--file. shorthand options are provided for the common cases of fd 0 (stdin), fd 1 (stdout), and fd 2 (stderr). these should suffice in most cases. โจ-i,--stdinโ shorthand for--fd 0. ๐-o,--stdoutโ shorthand for--fd 1. ๐-e,--stderrโ shorthand for--fd 2. ๐-c,--checkโ exit, without executing command, in case of any error while manipulating a file or file descriptor. the default behavior if this is not specified is to emit a warning to standard error and continue. โญ-q,--quietโ do not report non-fatal errors to standard error. this option does not affect the normal output of--get,--verbose,--help, or--version. ๐-v,--verboseโ if specified with--get,pipeszwill emit a descriptive header above the table. otherwise, if specified,pipeszwill print the actual buffer sizes set by the kernel to standard error. ๐-h,--helpโ display help text and exit. ๐ธ-V,--versionโ display version and exit. ๐ธ
๐ EXAMPLES ๐
pipesz dd if=file bs=1M | ...
runs dd(1) with an expanded standard output pipe, allowing it to avoid context switches when piping around large blocks. she ate. ๐
pipesz -s1M -cf /run/my-service.fifo
sets the pipe buffer size of a service FIFO to 1,048,576 bytes. if the buffer size could not be set, pipesz exits with an error. ๐
echo hello | pipesz -g
prints the size of pipe used by the shell to pass input to pipesz. since pipesz does not read standard input, it may also report 6 unread bytes in the pipe, depending on relative timings. ๐
find /proc/PID/fd -exec pipesz -gqf '{}' ';'
prints the size and number of unread bytes of all pipes in use by PID. if some pipes are routinely full, pipesz might be able to mitigate a processing bottleneck. ๐ฅ
๐ฆ NOTES ๐ฆ
linux supports adjusting the size of pipe buffers since kernel 2.6.35. this release also introduced /proc/sys/fs/pipe-max-size. ๐
this program uses fcntl(2) F_GETPIPE_SZ/F_SETPIPE_SZ to get and set pipe buffer sizes. ๐ง
this program uses ioctl(2) FIONREAD to report the amount of unread data in pipes. if for some reason this fails, the amount of unread data is reported as 0. ๐
๐ BUGS ๐
before linux 4.9, some bugs affect how certain resource limits are enforced when setting pipe buffer sizes. see pipe(7) for details. (iykyk โ old kernels were going through it fr fr)
๐ AUTHORS ๐
Nathan Sharp <nwsharp@live.com> โ absolute legend, main character energy.
๐ธ SEE ALSO ๐ธ
๐ซถ REPORTING BUGS ๐ซถ
for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>. bestie will hear you out, no cap.
๐ AVAILABILITY ๐
the pipesz command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. go get her. ๐๏ธ
and that's the whole page, bestie โจ โ this one's from util-linux 2.42.4, dated 2026-09-21, and it's genuinely iconic. go resize some pipes, you got this. ๐๐ ๐ฆ
๐ฆ where this page comes from
- arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms