Code:
echo data > data.txt
will create a file called data.txt containing data.
If the file exists it will be overwritten.
Code:
echo data >> data.txt
will add data to the end of the file data.txt.
It will create it if it doesn't exist.
Hope this helps.