Thursday, August 1, 2019

Combine two files in Linux and create one

To combine two or more files and create a single file with the content of all files clubbed:

Suppose we have 2 files namely file1 and file2.

File1 contains

this is file1 data

File2 contains

this is file2 data


Now, to combine Fiile1 and File2 

cat File1 File2 > File3

File3 will have the contents as

this is file1 data
this is file2 data