Using “tee” to write to files and the terminal
(Backup from Wednesday, April 21, 2010)
http://embraceubuntu.com/2007/05/17/using-tee-to-write-to-files-and-the-terminal/ Another alternative is: sudo sh -c “echo localhost 127.0.0.1 > filename.txt” Careful with that last command : echo “localhost 127.0.0.1″ | sudo tee filename.txt > /dev/null will over write, and not append “filename.txt” to append : sudo bash -c “echo “It works” >> filemane.txt’















