Concatenating multiple text files into a single file in Bash

前端 未结 12 1594
眼角桃花
眼角桃花 2020-11-29 15:31

What is the quickest and most pragmatic way to combine all *.txt file in a directory into one large text file?

Currently I\'m using windows with cygwin so I have acc

12条回答
  •  一整个雨季
    2020-11-29 16:05

    type [source folder]\*.[File extension] > [destination folder]\[file name].[File extension]
    

    For Example:

    type C:\*.txt > C:\1\all.txt
    

    That will Take all the txt files in the C:\ Folder and save it in C:\1 Folder by the name of all.txt

    Or

    type [source folder]\* > [destination folder]\[file name].[File extension]
    

    For Example:

    type C:\* > C:\1\all.txt
    

    That will take all the files that are present in the folder and put there Content in C:\1\all.txt

提交回复
热议问题