Sometimes you might want to hook into the output (stdout or stderr) of a running process, eg. of some periodically triggered script.
Find out the process id:
ps ax | grep ‘processname’
Watch the I/O stream (replace
PROCIDwith the process id from (1) and
NUMwith the desired I/O stream, where 0: stdin, 1: stdout and 2: stderr):
tail -f /proc/PROCID/fd/NUM