Here’s a quick way to create a file with some text in it:
$ cat >> myfile <<NEWFILE
Now type some text, and when you have finished simply type NEWFILE on a new line and you have got yourself a file called myfile, containing some text.
If you supply a filename that already has some text in it, the contents you type in will append to the original file.
If you use the tab key, please note that some older shell versions do not preserve the meaning of tabs. To overcome this simply use a hyphen after the two left angled brackets, like this.
cat >> myfile <<- NEWFILE ...