Overwrite/Make New

When you want a multi line write to a file using sudo:

$ sudo tee /tmp/test.txt << EOF
LINE 1
LINE 2
...
LINE n
EOF

Append

For appending new lines

$ sudo tee -a /tmp/test.txt << EOF
LINE 1
LINE 2
...
LINE n
EOF

Done.