split - Split files into pieces

Synopsis

split [-b byte_count[k|m]] [-l line_count] [file [prefix]]

Description

The split utility reads the given file (or standard input if no file is specified) and breaks it up into files of 1000 lines each.

Options

-b
Create files that are byte_count bytes in length. If k is appended to the number, the file is split into byte_count kilobyte pieces. If m is appended to the number, the file is split into byte_count megabyte pieces.
-l
Create files that are line_count lines in length.

Operands

If additional arguments are specified, the first is used as the name of the input file which is to be split. If a second additional argument is specified, it is used as a prefix for the names of the files into which the file is split. In this case, each file into which the file is split is named by the prefix followed by a lexically ordered suffix in the range of "aa-zz". If the prefix argument is not specified, the default prefix is "x". The maximum number of possible output file names is 676.

Exit Status

Related information

Examples

  1. Split the file jdk_v11.jar into files that are 1.44MB in size and use the prefix "jdk_v11.". for the output files.
    split -b1440k jdk_v11.jar jdk_v11.
    
  2. Split the file myapp.java into files of 100 lines each.
    split -l 100 myapp.java