I have a large folder containing many sub-directories each holding many .txt
files. I want to concatenate all of these files into one .txt
file. I am able to do it for each of the sub-directories with cat *.txt>merged.txt
, but I am trying to do it for all of the files in the large folder. How do I do this?
How to concatenate files from different sub-directories
catfindmerge
Best Answer
try with
find all '*.txt'
f
iles in/path/to/source
recursively for sub-directories and concatenate all into onemergedfile
.To concatenate each sub-directories files within its directory, do: