If all the files have the same parameters, like sample rate and number of channels, you still can't just catenate them. You have to strip away the WAV header.
It may be easiest to use an audio file manipulation utility like
sox, which contains a method for catenating files. In fact, it does this by default. E.g. to combine three .wav files into one long one:
$ sox short1.wav short2.wav short3.wav long.wav
A loop will not arrange the files in the order you want. What you want is to sort the names, but treat them numerically.
sort -n will do this.
$ sox $(ls *.wav | sort -n) out.wav
sox cannot handle that many files, we can break up the job like this:
$ ls *.wav | sort -n > script
Then we have a script file which looks like:
We edit that to make several command lines:
# catenate about half the files to temp1.wav
# catenate the remainder to temp2.wav
# catenate the two halves
sox temp1.wav temp2.wav out.wav ; rm temp1.wav temp2.wav
As the first editing step on the file list, you can use the
:%s/.*/& \\/ to add a backslash after every line.