How to append contents of multiple files into one file

前端 未结 11 2128
既然无缘
既然无缘 2020-12-22 15:49

I want to copy the contents of five files to one file as is. I tried doing it using cp for each file. But that overwrites the contents copied from the previous file. I also

11条回答
  •  春和景丽
    2020-12-22 16:39

    If you want to append contents of 3 files into one file, then the following command will be a good choice:

    cat file1 file2 file3 | tee -a file4 > /dev/null
    

    It will combine the contents of all files into file4, throwing console output to /dev/null.

提交回复
热议问题