GNU Split: Examples and Reference

Last updated:

WIP ALERT This is a work in progress

Split is a very useful tool included in most Linux distributions. It can be used to split large files into smaller parts according to a variety of parameters:

Basic example

Default behaviour is to split file into parts containing 1000 lines

$ split largefile.txt

Split file into files each containing given number of lines

For example, have each part have 1 thousand lines:

$ split -l 1000 largefile.txt

Split file into files each containing given size (in bytes)

For example, 10MB

$ split largefile.txt -b 10MB

Split file into n files, where each chunk will have totalSize / n lines

For example, divide a large file into 10 parts

$ split largefile.txt -n 10

See also

Dialogue & Discussion