39

How do I split a 7GB (movie) file into smaller files of (say) 1GB, and then (in another Ubuntu computer) integrate them to get the original file (using just bash commands)?

0

2 Answers 2

54

To split:

split -b 1G -d bigfile bigfile-part

To join:

cat bigfile-part* > bigfile
2
  • 6
    +1 best method. I usually like to check that everything worked by running 'md5sum bigfile' before and after.
    – scottl
    Nov 10, 2010 at 3:15
  • it didn't want the -d
    – xxjjnn
    Jan 10, 2014 at 15:07
24

To split the file into 1024MBs, using a terminal:

split --bytes=1024m original_filename /destination/path/prefix

To get the original file:

cat /source/path/prefix* > original_filename
1
  • this works in Mac OS X High Sierra Sep 20, 2019 at 5:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.