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
| Name | Type | Description |
|---|---|---|
| -l | option | Lines per part |
| -d | option | Numeric suffixes |
| -b | option | Bytes per part |
| INPUT | operand | Input file |
| PREFIX | operand | Output 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