reredirect(1)
π reredirect(1) β like, the redirect-your-running-process girly β¨
okay so real talk, this is a page from the General Commands Manual, and it's about the icon that is reredirect. buckle up bestie π
β¨ NAME β¨
reredirect β the tool that dynamically redirects the outputs of a process that's already running π no restart, no relaunch, we just slide in π
π¦ SYNOPSIS π¦
reredirect [-i FILE |-i FD ] [-m FILE |-o FILE |-e FILE |-I FD |-O FD
|-E FD ] [-N] [-d] PID
πΈ DESCRIPTION πΈ
okay so reredirect is this utility that takes a program that is already running and attaches its input/outputs β that's standard output and error output, iykyk β to files or to another process. literally just vibes-based plumbing π«Ά
the simple usage is giving:
reredirect -m FILE PID
and it will redirect the outputs of PID to FILE. slay β¨
you can also redirect standard input, output and error output into different files, which is honestly so main character:
reredirect -i FILE1 -o FILE2 -e FILE3 PID
and just so you know, the -m option is literally just a shortcut to -o FILE -e FILE. that's it. that's the whole thing π
after it launches, reredirect gives you a command to restore the state of PID. it will look something like:
reredirect -N -I 4 -O 5 -E 3 5453
and yes β -I, -O and -E act like -i, -o and -e but with file descriptors that are already opened in PID. they're only used to restore the previous state of PID, no cap π§
π OPTIONS π
-i FILEβ the file you want to redirect stdin to π-o FILEβ the file you want to redirect stdout to π-e FILEβ the file you want to redirect stderr to π-m FILEβ same than-o FILE -e FILE, a two-for-one deal π-I FDβ redirect stdin to this file descriptor. mainly used to restore process input π₯-O FDβ redirect stdout to this file descriptor. mainly used to restore process outputs β-E FDβ redirect stderr to this file descriptor. mainly used to restore process outputs π-Nβ do not save the previous stream, we're moving on bestie π-Vβ print the version ofreredirectand exit π«-hβ print a usage message and exit π-vβ print verbose debug output while running, for the nosy girlies π
β οΈ NOTES β οΈ
okay this part matters so pay attention bestie π
reredirect depends on the ptrace(2) system call to attach itself to the remote program. and on Ubuntu Maverick and higher, that ability is disabled by default for security reasons. yeah. π
you can enable it temporarily by doing:
# echo 0 > /proc/sys/kernel/yama/ptrace_scope
as root, or permanently by editing the file /etc/sysctl.d/10-ptrace.conf, which β fun fact β also contains more information about this setting π¦
π BUGS π
bugs should be reported to the author (see below) or via the issue tracker on GitHub. please be nice about it π«Ά
π AUTHORS π
reredirect was mainly written by JΓ©rΓ΄me Pouiller <jezz@sysmic.org>. you can contact hom β yes, the manpage says "hom", we love a typo moment π
β for any questions or bug reports.
also, reredirect (and especially all the ptrace layer) is based on the reptyr programm (typo number two, iconic). reptyr was written by Nelson Elhage <nelhage@nelhage.com> β¨
π HOMEPAGE π
β¨https://github.com/jerome-pouiller/reredirectβ©
and that's the whole page, bestie π this gem dropped 26 Aug 2014 with the source/version stamp reredirect(1) β go redirect something and live your truth, periodt ππ
π¦ where this page comes from
- nixos 26.05: reredirect-unstable 2026-02-15
- nixpkgs unstable: reredirect-unstable 2026-02-15
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms