SPLIT(1) General Commands Manual SPLIT(1)

splitsplit a file into chunks

split [-b size | -l lines] [-a suffix_length] [file] [name]

split reads file or if unspecified standard input, and splits it's content into files containing at most size or lines. Each split file name is made with name followed by a base-26 (a-z) suffix of exactly suffix_length characters. By default, the first split suffix is "aa", then the second is "ab", and so on.

suffix_length
(Default: 2) Set the amount of letters to use for the suffix portion of split files.
Total of name size and suffix_length cannot exceed NAME_MAX.
size
Split into files of size bytes, size can be multiplied by one of KMGTP (Kilo, Mega, Giga, Tera, ...) using power of 1024 by default, which can be either explicit via adding iB (like MiB), or turned into powers of 1000 by adding B (like MB).
lines
(Default: 1000) Split into files of lines lines.

file
Path to the file to be split, defaults to - if unspecified.
name
Prefix to be used for each split file, defaults to ‘x’.
Total of name size and suffix_length cannot exceed NAME_MAX.

The split utility exits 0 on success, and >0 if an error occurs.

csplit(1), truncate(1)

split should be compliant with the IEEE Std 1003.1-2024 (“POSIX.1”) specification.

Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>

2024-08-16 Linux 6.6.67-gentoo-x86_64