How to make cat start a new line

前端 未结 6 631
情话喂你
情话喂你 2021-01-18 02:24

I have four files:

one_file.txt

abc | def

two_file.txt

ghi | jkl

three_file.txt

m         


        
6条回答
  •  佛祖请我去吃肉
    2021-01-18 02:47

    You can use one line for loop for this. The following line:

    for f in *_file.txt; do (cat "${f}") >> full_set.txt; done
    

    Yields the desired output:

    $ cat full_set.txt 
    abc | def
    mno | pqr
    ghi | jkl
    

    Also, possible duplicate.

提交回复
热议问题