Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using nohup -> output to file and console

iam using nohup in my project. Is there a possibility get the Output of the program to the console and to the file at the same time while using nohup?

With "tee"i had no sucess:

nohup ./programm 2>&1 | tee Output.txt

thanks for help

like image 670
user3707049 Avatar asked Mar 11 '23 18:03

user3707049


1 Answers

Try this to run and log the output in file.

nohup ./program  > Output.txt | tail -F Output.txt &

If you want to run it in background:

nohup ./program  > Output.txt &
like image 186
Manish Singh Avatar answered Mar 20 '23 21:03

Manish Singh