0

I know you can save the output of executing a script/file to another file by using:

./script.sh >> script_output.log

but this doesn't display the output in terminal during execution. Is there any way to also save the contents of execution in a file and display the messages in the terminal, during the script's execution?

Thank you in advance

1 Answers1

3

What you need is tee:

./script.sh | tee -a script_output.log

The -a parameter appends to the output file, since you used >> in your example.

AFH
  • 17,958