Another solution:
cat file1 | tee -a file2
tee
has the benefit that you can append to as many files as you like, for example:
cat file1 | tee -a file2 file3 file3
will append the contents of file1
to file2
, file3
and file4
.
From the man page:
-a, --append
append to the given FILEs, do not overwrite