I have the following situation. A directory with really a lot of subdirectories, and each of those subdirectories contains a file of interest that I want to concatenate. e.g.,
my_dir/
subdir1/
subsubdir/
file_of_interest1.txt
...
subdir2/
subsubdir/
file_of_interest1.txt
...
...
Now, I tried using cat my_dir/*/*/*.txt > all.txt
But unfortunately, the subdirectory tree is so large that I get the following error:
bash: /bin/cat: Argument list too long
Is there a clever way to circumvent the problem, e.g., by concatenating the files in smaller chunks? E.g., concatenating 1/3 of the subdirs, then another 1/3 and 1/3, and then joining them alltogether?