Text Processing

split

Splits a file into pieces.

split breaks large files into smaller files by line count, byte size, or other limits.

Syntax
split [options] file [prefix]

Arguments explained

  • -l sets lines per file.
  • -b sets bytes per file.
  • -d uses numeric suffixes.

Common examples

Split by lines
split -l 1000 big.log chunk-

Creates chunk-aa, chunk-ab, and so on with 1000 lines each.

Split by size
split -b 100M archive.tar archive.part-

Creates 100 MB chunks.

split Command
FieldDetails
Commandsplit
CategoryText Processing
Primary useSplits a file into pieces.
Syntaxsplit [options] file [prefix]