Bash stdout & write output to file

To display dual output on standard output (stdout) and write or append the output to a file, use tee. For example, do the following:

python ./myscript.py | tee -a output.log

The output from the script is piped to tee and tee prints to stdout and appends to the specified log file.

Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment