Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where is the output goes when running as a background process?

Tags:

linux

My process output some log information to the console windows. When I run it as a background process, where can I find the output logs?

like image 404
Adam Lee Avatar asked Jul 05 '12 14:07

Adam Lee


1 Answers

Depends on the process and how you started it. If it writes to stdout (which is probable, given that the output is usually to the terminal), you can redirect the output to a file with

command > logfile &

If you also want to log error message from stderr, do

command > logfile 2> errorlogfile &

or

command > logfile 2>&1 &

to get everything in one file.

like image 189
Fred Foo Avatar answered Sep 24 '22 23:09

Fred Foo