Recently I was trying to figure out how to output text from a command to both a text file and the console. My twitter friends weren't sure how to do this but fortunately a friend of mine reminded me of a handy little tool named tee.
from the tee man file:
tee - read from standard input and write to standard output and files
A simple example of using tee:
`cat somefile.txt | tee output.txt`
So next time you need to write to both the console and a text file don't get so Tee'd off! (cheesy I know)
No comments:
Post a Comment