Wednesday, August 24, 2016

Combine content of two files in unix

$ cat file1 file2 > file3

It will combine both file1 and file2 content in file3. Here in above command it will overwrite in file3 if any content is existing.

If you wish to append the existing content in file3 you can use below command:

$ cat file1 file2 >> file3

Here if you use > it will overwrite and if you use >> it will append or add

No comments:

Post a Comment