How to append one file to another in Linux from the shell?

asir picture asir · Feb 11, 2011 · Viewed 474.5k times · Source

I have two files: file1 and file2. How do I append the contents of file2 to file1 so that contents of file1 persist the process?

Answer

David picture David · Feb 11, 2011

Use bash builtin redirection (tldp):

cat file2 >> file1