Concatenate multiple files but include filename as section headers

前端 未结 20 1703
粉色の甜心
粉色の甜心 2020-12-12 09:08

I would like to concatenate a number of text files into one large file in terminal. I know I can do this using the cat command. However, I would like the filename of each fi

20条回答
  •  醉酒成梦
    2020-12-12 09:24

    If the files all have the same name or can be matched by find, you can do (e.g.):

    find . -name create.sh | xargs tail -n +1
    

    to find, show the path of and cat each file.

提交回复
热议问题