(Video materials in preparation)
distribute2 : Divides a file into portions with equality.
Usage : distribute2 [-a] <file1> <file2> ... <file>
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 1
The command divides an input file <file> into files with equal size
keeping each block having an equal size. As the command splits a file
at the line feeds, the size of each block is not necessarily equivalent.
The command works faster than distribute since the content is split into
blocks.
The <file> must designate a regular file.
Use the -a option to write content in the append mode.
$ cat data
1 a
2 b
3 c
4 d
5 e
6 f
7 g
8 h
9 i
10 j
$ distribute2 file1 file2 file3 data
$ cat file1
1 a
2 b
3 c
4 d
$ cat file2
5 e
6 f
7 g
$ cat file3
8 h
9 i
10 j
$ distribute2 -a file1 file2 file3 data
$ cat file1
1 a
2 b
3 c
4 d
1 a
2 b
3 c
4 d