This question already has an answer here:
I started a process from the command line, but the window server died. However I see the process I started is still running. Is it possible to connect a terminal to the process to see its output?
This is the process:
ps -A | grep foo 73186 ?? 4011:34.91 ./foo