You can use Linux echo command with redirection operator (> | >>) to write the output of echo command to a file. If the destination file does not exist, it will create it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
echo "hello world" > hello.txt ## redirects the output to hello.txt echo "welcome to cloudaffaire" >> hello.txt ## appends the output to hello.txt cat hello.txt echo -e "hello\nworld" > hello.txt ## multiple lines cat hello.txt ## Alternet way cat < Hello world welcome to cloudaffaire! EOF cat hello.txt |