Damage a huge documents right into smaller sized items
You can make use of
As an example something like
$ split --bytes 500M --numeric-suffixes --suffix-length=3 foo foo.
(where the input filename is
foo and also the last argument is the result prefix ). This will certainly create documents like
foo.000 foo.001 ...
The very same command with brief alternatives :
$ split -b 100k -d -a 3 foo foo
You can additionally define "-- line-bytes" if you desire it to split on line borders as opposed to simply specific variety of bytes.
For re-assembling the created items once more you can make use of e.g. :
$ cat foo.* > foo_2
(thinking that the covering types the outcomes of covering globbing - and also the variety of components does not go beyond the system reliant restriction of debates )
You can contrast the outcome using :
$ cmp foo foo_2 $ echo $?
(which needs to result 0 )
Alternatively, you can make use of a mix of find/sort/xargs to re-assemble the items :
$ find -maxdepth 1 -type f -name 'foo.*' | sort | xargs cat > foo_3