On the command line, you can do this more directly with cat. Redirect its output to the file and type the input line by line on cat's standard input. Press Ctrl+D at the beginning of the line to indicate the end of the input.
$ cat >foo.txt
First line.
Second line.
Third line.
Ctrl+D
You can use a string literal containing newlines.
echo 'First line.
Second line.
Third line.' >foo.txt
or
echo $'First line.\nSecond line.\nThird line.' >foo.txt
Another possibility is to group commands.
{
echo 'First line.'
echo 'Second line.'
echo 'Third line.'
} >foo.txt
cat filename
#read file
cat filename1 filename2
#cancantenate two files and show
wc
#word count aka lines,words, bytes
diff filename1 filename2
#difference via < the tail of crocodile points to filewhich includes the change
nano filename
#nano is ubuntu text base editor