Strace-based tty logger for linux.
Handy if you need to clone another user's terminal output.
Usage: ttylogger pid
Use user shell's pid to trace all subsequent processes.
Terminal output from all processes is replicated. User input will show up if it's echo'ed to the terminal.
Be aware that strace is not terribly fast at handling tons of child processes (think, very long pipes), so this will slow things down quite a bit.
For a much (much) better alternative see ptysnoop. In fact the only reason to use this is that somehow you can't use ptysnoop.
If your system has ptrace protection you might need to
$ sudo ttylogger pid
instead or disable ptrace protection entirely:
$ sudo echo 0 > /proc/sys/kernel/yama/ptrace_scope
- ptysnoop
- For *BSD systems: watch
- ttyrpld: multi-os kernel-level tty logger with (a)synchronous replay support
In case you're just looking for a way to redirect output of an already running process check out
screen / reredirect / dupx