6

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?

luca
  • 1,733
  • 2
  • 17
  • 23

1 Answers1

8

Use tee:

command | tee -a mylog.txt

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

Dennis Williamson
  • 106,229
  • 19
  • 167
  • 187