bash write file

cat <<EOF | sudo tee /etc/test.txt
Hello World
EOF
AttractivePenguin