Ot create a file and pipe something into it whatever you like you can use the redirect to a file
echo "hello" > /tmp/temp.txt
This will open a new file or overwrite an existing file in the same location and then put the text hello into /tmp/temp.txt. If you want to add addtional lines use the following command
echo "hello chris" >> /tmp/temp.txt
You file will then contain hello followed by hello chris to move this file from one location to the other use the following code
mv location1 location2
e.g
mv /tmp/temp.txt /tmp/finished.txt