Linux Split & Join Large File


Assume the large file is 2G and I need to split it into multiple files of 700M.

split -b 700M large.dat# this will produce
# xaa 700M
# xab 700M
# xac 600M
split -b 700M large.dat small.dat.x# this will produce
# small.dat.xaa
# small.dat.xab
# small.dat.xac
The  SIZE  argument  is  an  integer  and  optional  unit  (example: 10K is 10*1024).  Units areK,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).


Assume my output files are xaa, xab & xac. To join the file

cat x* > large.dat
cat xa{a..c} > large.dat



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kevin FOO

Kevin FOO

A software engineer, a rock climbing, inline skating enthusiast, a husband, a father.