user3707049
user3707049

Reputation: 65

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

Upvotes: 5

Views: 20473

Answers (1)

Manish Singh
Manish Singh

Reputation: 538

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 &

Upvotes: 9

Related Questions