csplit

Split a file into pieces. This generates files named "xx00", "xx01", and so on. More information: https://www.gnu.org/software/coreutils/csplit.

csplit path/to/file 5 23

csplit path/to/file 5 {*}

csplit -k path/to/file 5 {*}

csplit path/to/file 5 -f prefix

csplit path/to/file /regular_expression/