Now we know how to overwrite a file’s contents, but what if we want to be able to add to a file without losing the original text? We can use the
$ cat deserts.txt >> forests.txt
>> takes the standard output of the command on the left and appends (adds) it to the file on the right.
Here, the output data of forests.txt will contain the original contents of forests.txt with the content of deserts.txt appended to it.
>> to append the contents of glaciers.txt to rivers.txt.
cat to view the contents of rivers.txt.
Notice that we see rivers and glaciers as output.