You can create a new (or overwrite an existing) file with > For example:
Code:
echo Here is some text > test.txt
You can append to that file with >> For example:
Code:
echo Some more text >> test.txt
You can create a file and add several lines to it with the following syntax:
Code:
cat > another.file << "EOF"
Here is a line of text
Some more text
Even more text
EOF
Was that what you were looking for?