How to copy files into a new file

I think what you are lookig for is to append which is done using >> symbol:

Let say you have file1 with the content I'm file1 and file2 with the content I'm file2

Then you can do:

cat file1  >> file2   

This appends content of file1 to the end of file2.

now the result of file2` will be:

I'm file2
I'm file1

You can repeat the same command to add more as many more files as you like to the bottom of a file.


Let us say that you have file1, file2, file3 ... Then I suggest that you

  • either create a target file. Then the command

    cat file* > target
    
  • or have a target file and want to append to it. Then the command

    cat file* >> target
    

will do what you want.