tee

tee- splits standard input so it display on standard output and other files you specify.

 

Usually used with pipes, so data can be stored in a file and immediately viewed on screen.

 

runprog | tee newfile.txt