How to merge many files together? [duplicate]
I have around 58,000 txt files that have the prefix ppdb-
in a directory. I want to merge all of them into one file.
Wgen I try to merge them using cat ppdb-* >> out.txt
it gives me an error saying "-bash: /usr/bin/cat: Argument list too long".
Is there a way to merge all the files together efficiently?
Read man find xargs
and do something like: (UNTESTED, remove echo
when your tests succeed)
find . -maxdepth 1 -name 'ppdb-*' -print0 |\
xargs -0 -r echo cat >out.txt