Is there any way to concatenate multiple text files in numerical order of the file names with one bash command ?
I tried this, but for some reason, the first three l
update for anishsane's answer.
printf "%s\0" *txt | sort -k1.thecharlocation -zn | xargs -0 cat > all.txt
thecharlocation is the first key you want to sort. If your file name is file01.txt, thecharlocation is 5.
thecharlocation
file01.txt
5
See also another similar answer from Nate in this question.