In Bash, I'd like to redirect stdout to a file (>> mylog.txt) but also see the stdout output on the screen..

How can I do it with bash?


Use tee:

command | tee -a mylog.txt

will append the output of the command to the file and also show it on screen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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