Saturday, February 11, 2012

How to redirect output to screen and a file

With the command tee (in Linux) or the command wtee (in Windows)

Example (in Linux)

ls | tee output.txt

Example (in Windows)

dir | wtee > output.txt

No comments:

Post a Comment