Skip to content
Advertisement

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

Advertisement

Answer

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 &
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement