How do I break a large, +4GB file into smaller files of about 500MB each.
And how do I re-assemble them again to get the original file?
You can use split and cat.
For example something like
(where the input filename is
The same command with short options:
The split commands generate pieces named:
For re-assembling the generated pieces again you can use e.g.:
(assuming that the shell sorts the results of shell globbing - and the number of parts does not exceed the system dependent limit of arguments)
You can compare the result via:
(which should output 0)
Alternatively, you can use a combination of find/sort/xargs to re-assemble the pieces:
You can also do this with Archive Manager if you prefer a GUI. Look under 'Save->Other Options->Split into volumes of'.
lxsplit does splitting and joining allowing you to specify chunk size.