Linux: split file into pieces and join pieces again


Sun Aug 28 2022 22:49:43 GMT+0000 (Coordinated Universal Time)

Saved by @marcopinero #bash

#split the file into pieces:

  $> split --bytes=10M /path/to/bigfile.ext /path/to/image/prefixForPieces

#then put'em together again when necessary

  $> cat prefixForPieces* > bigfile.ext

Some times is very useful to split a big file into small pieces for transferring over internet (specially if connection is not stable), and then join these pieces again to rebuild original file. I got this is a very simple task using these Linux commands.