One way to write a short text in terminal, instead of using a proper text editor, such as Libre Office or Abiword, is :
$ or #cat> filename.txt
enter
write your text
then close it with :
ctrl + D
It will be saved in directory where you opened a terminal window.