Insert file names when concatenate files into a file

Hi

I found the following line would concatenate all test_01 test_02 test_03 files into "bigfile".

cat test_* >> bigfile

But, what I'm looking for a way to insert each file names in order when concatenated in "bigfile".

Thank you
samky2005

You can use a loop like this:

for i in test_*; do echo Filename : "$i";echo;cat "$i"; done > bigfile
1 Like

Thank you so much!
It worked.:slight_smile: