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?
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?
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
or
cat xaa xab xac > newfile
in case the filenames aren't in alphabetical order.
cat xaa xab xac > newfile
– binarybob Mar 13 '12 at 19:57sha256sum filename
on Ubuntu andopenssl sha -sha256 filename
on OS X.) When I concatenated it to an HTFS+ drive the concatenated file was correct. – Chris Oct 20 '17 at 11:11cat xaa xab xac > newfile
, thennewfile
ends up just being the same contents asxaa
. On OSX Sierra. What am I missing? – Adam Parkin May 31 '19 at 18:15