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?

link|improve this question

62% accept rate
Duplicate: superuser.com/questions/159059/… – therefromhere Feb 27 '11 at 15:45
feedback

1 Answer

up vote 5 down vote accepted

Use tee:

command | tee -a mylog.txt

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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