Reputation: 3674
I am looking for a command that will concatenate multiple files in a directory tree with sames having a pattern such that the resulting file has contents of all the files separated by the name(path) of each file. I tried using find -exec and sed but couldn't succeed.Please help. More specifically I have a directory containing many sub-directories having file named 'test.FAILED'. I want to concatenate all the test.FAILED files separated by their Paths so that I can have a look at all of them at the same time.
Upvotes: 1
Views: 2188
Reputation: 6656
Using (gnu) find:
find . -name \*.FAILED -print -exec cat "{}" \;
Upvotes: 2