ptee(1)
π ptee β the manual page, but make it a group chat π
okay so bestie, you found the ptee(1) page. it's a User Commands girlie, and she's literally the piped version of tee(1). let's get into it π«Ά
β¨ NAME β¨
ptee β piped tee: read from one file descriptor and copy to many π
π SYNOPSIS π
ptee [-h] [-r infd] outfd1 [outfd2 ...]
that's the whole vibe. one input, a whole squad of outputs. π
π¦ DESCRIPTION π¦
so here's the tea: ptee reads from one file descriptor β that's 0 / stdin by default, no cap β and then copies literally everything it reads to all the output file descriptors you hand it. all of them. every single one. it's giving "one message, many group chats." π
she's a piped version of tee(1), which is the whole point. tee(1) is great but she's out here working with files and pipes in a specific way, and ptee is the version that just speaks file descriptor. iykyk.
and here's the iconic part: you can use ptee together with pipexec(1) to fit the output of one command into many other commands. one command's output, fanned out to a bunch of other commands. no middleman. no temp files. we love a direct line. π
π OPTIONS π
-hβ prints help and version information. the "hey bestie, what are you" flag. π-rinfd β use the given infd as the input file descriptor. if you don't specify this one,0(stdin) gets used by default. simple as that. β¨
π₯ EXAMPLES π₯
duplicating to a whole crew
want to duplicate all data from stdin to stdout, stderr and fd 7? say less:
ptee 1 2 7
the tee equivalent moment
the command
tee output.txt
is equivalent to the shell command
ptee 5 5>output.txt
same energy, different fit. π
the pipexec(1) collab π€
okay this one is the main character. using pipexec(1): count all files in the file system and additionally count only those that have a uppercase 'A' in their name. and listen β the file system will be scanned only once. no temporary files are generated. not a single one. efficiency queen. π
pipexec [ LS /bin/ls -R / ] [ PTEE /usr/bin/ptee 3 4 ] \
[ WC1 /usr/bin/wc -l ] [ GREP /bin/grep A ] \
[ WC2 /usr/bin/wc -l ] "{LS:1>PTEE:0}" "{PTEE:3>WC1:0}" \
"{PTEE:4>GREP:0}" "{GREP:1>WC2:0}"
look at that wiring. LS into PTEE, PTEE out to WC1 and GREP, GREP into WC2. gorgeous. no notes. πΈ
π SEE ALSO π
pipexec(1), peet(1), tee(1) β go read the family, they're all icons. π§
π AUTHOR π
Written by Andreas Florath (andreas@florath.net). legend behavior, honestly. π
π COPYRIGHT π
Copyright Β© 2015 by Andreas Florath (andreas@florath.net). License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
real talk: this page came from the User Commands section, dated 2015-03-14, and that's the whole thing bestie β ptee(1), read once, copy everywhere, no temp files, periodt. π
β¨π¦
π¦ where this page comes from
- alpine 3.24: pipexec-doc 2.6.2-r0 Β· GPL-2.0-or-later
- debian bookworm: pipexec 2.6.1-2 Β· GPL-2.0-or-later
- debian trixie: pipexec 2.6.2-1 Β· GPL-2.0-or-later
- ubuntu jammy: pipexec 2.5.5-2 Β· GPL-2.0-or-later
- ubuntu noble: pipexec 2.6.1-3 Β· GPL-2.0-or-later
- ubuntu questing: pipexec 2.6.2-1
- ubuntu resolute: pipexec 2.6.2-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: pipexec 2.6.2-1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms