commands

split — split input into files

Create output parts. GNU -l sets lines per part, -d numeric suffixes, -b byte size (may split a line or multibyte character). Use fresh prefix to avoid overwriting. Example assumes a fresh text-streams lab fixture.

Formal Syntax & Structure

linux syntaxlinux
split [OPTION]... [INPUT [PREFIX]]

Parameters & Attributes

NameTypeDescription
-loptionLines per part
-doptionNumeric suffixes
-boptionBytes per part
INPUToperandInput file
PREFIXoperandOutput name prefix

Return Value

exit status and output

GNU split writes named output parts and returns nonzero on failure. A failed operation may leave earlier parts; inspect the expected filenames and reconstruct the original bytes before relying on them.

Working Example

Example Snippetlinux
mkdir partssplit -l 2 -d events.txt parts/chunk-cat parts/chunk-01
Linux Reference