split
Options
--bytes=<SIZE>,-b <SIZE>-
split-help-bytes
--line-bytes=<SIZE>,-C <SIZE>-
split-help-line-bytes
--lines=<NUMBER>,-l <NUMBER>-
split-help-lines
--number=<CHUNKS>,-n <CHUNKS>-
split-help-number
--additional-suffix=<SUFFIX>-
split-help-additional-suffix
--filter=<COMMAND>-
split-help-filter
--elide-empty-files,-e-
split-help-elide-empty-files
-d-
split-help-numeric-suffixes-short
--numeric-suffixes=<FROM>-
split-help-numeric-suffixes
-x-
split-help-hex-suffixes-short
--hex-suffixes=<FROM>-
split-help-hex-suffixes
--suffix-length=<N>,-a <N>-
split-help-suffix-length
--verbose-
split-help-verbose
--separator=<SEP>,-t <SEP>-
split-help-separator
--io-blksize
Examples
Split a file, each split having 10 lines (except the last split):
split {{[-l|--lines]}} 10 {{path/to/file}}
Split a file into 5 files. File is split such that each split has same size (except the last split):
split {{[-n|--number]}} 5 {{path/to/file}}
Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes):
split {{[-b|--bytes]}} 512 {{path/to/file}}
Split a file with at most 512 bytes in each split without breaking lines:
split {{[-C|--line-bytes]}} 512 {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.