There may be instances whereby ps -aux
has been used to see the PID of a running process and you would like to see its output.
This can be done using:
tail -f /proc/{pid}/fd/1
Remember: replace {pid} with the PID of the process. 1 = stdout
, 2 = stderr
.
Bonus: to see the command used to execute the process, cat /proc/{pid}/cmdline | tr '\000' ' 'select
can be used.