Concatenating multiple text files into a single file in Bash

前端 未结 12 1604
眼角桃花
眼角桃花 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:13

    When you run into a problem where it cats all.txt into all.txt, You can try check all.txt is existing or not, if exists, remove

    Like this:

    [ -e $"all.txt" ] && rm $"all.txt"

提交回复
热议问题