append text to file terminal code example
Example 1: add a line at the end of a file linux
echo 'text here' >> filename
Example 2: bash add text to file
echo "hello world" >> my_file.txt
Example 3: append to a file from terminal
echo "text to append" >> filename
# for multiple lines
echo -e "line1\nline2\nline3" >> filename