Split a large file in Linux
Q. I am trying to move a large file, but I want to split it into chunks.
A. This can be done in using by piping the file into a split command (this also gzips the file):
Split
gzip -c largefile | split -b 512MiB - largefile_split.gz_
This will create a bunch of files:
largefile_split.gz_aa
largefile_split.gz_ab
largefile_split.gz_ac
etc...
Combine
Combining the file on the other side:
cat largefile_split.gz_* | gunzip -c > largefile
and that's it.
Last Updated on Friday, 09 September 2016 17:20
Add your comment
yvComment v.1.24.0