I am facing a problem with concatenating file with cat command as I have to concatenate120441 files together. In test directory, I have 120441 subdirectories which start with GC and every subdirectory contain a result_tab.txt file which I need to concatenate. I use the following command
cd test
cat GC*/result_tab.txt > result_all.txt
But error occurs " Argument list is too long". Then I use the following command
find . -name 'result_tab.txt' -exec cat {} + > result_all.txt
But when I see the result_all.txt file there is nothing. Any solution? I tried the following for loop too. But not working
for f in GC*/result_tab.txt; do cat "$f"; done > results_all.txt