Ubuntu how to combine multiple text files into one with terminal

后端 未结 1 1095
谎友^
谎友^ 2021-01-16 07:09

I want to combine multiple text files into one text file. Is there any command in ubuntu terminal to do this, or do I have to do it manually?

相关标签:
1条回答
  • 2021-01-16 07:33

    Try cat like

    cat file1 file2 file3 > outputFile
    

    cat stands for concatenation.

    > is for output redirection.

    If outputFile already has something in it and you wish to append to it the contents of other files, use

    cat file1 file2 file3 >> outputFile
    

    as > would erase the old contents of outputFile if it already existed.

    Have a look here as well.

    0 讨论(0)
提交回复
热议问题