How can I see the output console after running a nohup command? How can I see the output console after running a nohup command? linux linux

How can I see the output console after running a nohup command?


You can see the output in real time by running below from another terminal.

tail -f nohup.out


You can redirect standard output and standard error to a file and look at that file. eg:

nohup command 2>&1 > outputfile &

note default behavior from man page:

If standard output is a terminal, append output to 'nohup.out' if possible, '$HOME/nohup.out' otherwise. If standard error is a terminal, redirect it to standard output

so really you can just run

nohup command &

and then look in nohup.out