Click to See Complete Forum and Search --> : display in terminal and log it to a file


sushantdh
October 7th, 2010, 12:02 PM
Hello, if I am executing a command in DOS, how can I display it into the terminal window as well as log it in a file. So, for example if I want to do dir to view the contents in C:\, I want to view the contents in the terminal window as well as write the same thing to a file as well. So far I have

command1 >> C:\\export.log 2>&1

This will not show anything that command1 executed in the terminal window but rather shows it in export.log file. I want to show in both.

Any help is much appreciated.

Thanks
Sushant Dhakal

PeejAvery
October 14th, 2010, 10:53 PM
Microsoft itself never made this possible. However, you can do it in UNIX. And, even better...you can use the UNIX ported tee.

http://unxutils.sourceforge.net/