I've split a large file with the split command from a Terminal and copied it from a USB-stick to my MacBook.
This results in couple of files named 'xaa', 'xab', 'xac'.
How do I merge them together again from within a Terminal?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
cat xaa > newfile cat xab >> newfile cat xac >> newfile
Basically using a single '>' operand send the output to a new file. using a double '>>' operand makes it append the contents to the end of an existing file (and also out of interest create it if it does not already exist.
If all your files are definitely in a neat alphabetical order, then you could use:
cat x* > newfile
cat xaa xab xac > newfile
in case the filenames aren't in alphabetical order.