Opposite of Linux Split

shell, split

Solution

The magic command would be:

cat output_* > output.all

There is no need to sort the file names as the shell already does it (*).

As its name suggests, `cat` original design was precisely to conCATenate files which is basically the opposite of `split`.

(*) Edit:

Should you use an (hypothetical ?) locale that use a collating order where the `a-z` order is not `abcdefghijklmnopqrstuvwxyz`, here is one way to overcome the issue:

LC_ALL=C "sh -c cat output_* > output.all"

Problem

I have a huge file and I split the big file into several small chunks and divide and conquer. Now I have a folder contains a list of files like below: ``` output_aa #(the output file done: cat input_aa | python parse.py > output_aa) output_ab output_ac output_ad ... ``` I am wondering is there a way to merge those files back together FOLLOWING THE INDEX ORDER: I know I could do it by using ``` cat * > output.all ``` but I am more curious another magical command already exist comes with split..

Original source

Related problems