Logo

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

You can append one file to another using cat with the >> (append) redirection operator. For example:

cat file1 >> file2

This appends the contents of file1 to the end of file2, leaving file2’s existing content intact.

Notes

  • > overwrites (truncates) the existing file content, while >> appends to it.
  • If file2 does not exist, >> creates it.

Recommended Resource
For a deeper dive into problem-solving and coding efficiency, consider this course from DesignGurus.io:

CONTRIBUTOR
TechGrind