if you are not familiar with sed
, then you can use here document as alternative to help you write some text without open a text editor like vim
, nano
, etc.
bash
tee /path/to/dir/filename.txt << "EOF"
hemlo
EOF
you can use cat
, but with tee
, you have an advantage of saving a file as root using sudo
.
bash
cat >/path/to/dir/filename.txt << "EOF"
hemlo
EOF
read more about shell redirection on askubuntu