2

This question already has an answer here:

If I wanted to save output to a file from a command like make, I would do:

make > out.txt

However that stops the output from being displayed on the console window, and only saves to a file.

Is there a way to display output from a monitoring process, or a long make command and save it to a file?

marked as duplicate by Michael Homer, heemayl, cuonglm, cas, Community Apr 4 '16 at 10:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

You can use the tee command to send output to the screen and write the same contents to a file.

make | tee output.txt

If you want to append to the target file (like the >> output.txt redirection) instead of overwriting it, you should add the -a option to tee:

make | tee -a output.txt

Not the answer you're looking for? Browse other questions tagged or ask your own question.