Man Pages

split - phpMan split - phpMan

Command: man perldoc info search(apropos)  

File:,  Node: split invocation,  Next: csplit invocation,  Prev: tail invocation,  Up: Output of parts of files

5.3 `split': Split a file into fixed-size pieces

`split' creates output files containing consecutive sections of INPUT
(standard input if none is given or INPUT is `-').  Synopsis:

     split [OPTION] [INPUT [PREFIX]]

   By default, `split' puts 1000 lines of INPUT (or whatever is left
over for the last section), into each output file.

   The output files' names consist of PREFIX (`x' by default) followed
by a group of characters (`aa', `ab', ... by default), such that
concatenating the output files in traditional sorted order by file name
produces the original input file.  If the output file names are
exhausted, `split' reports an error without deleting the output files
that it did create.

   The program accepts the following options.  Also see *note Common

`-l LINES'
     Put LINES lines of INPUT into each output file.

     For compatibility `split' also supports an obsolete option syntax
     `-LINES'.  New scripts should use `-l LINES' instead.

`-b SIZE'
     Put SIZE bytes of INPUT into each output file.  SIZE may be, or
     may be an integer optionally followed by, one of the following
     multiplicative suffixes:
          `b'  =>            512 ("blocks")
          `KB' =>           1000 (KiloBytes)
          `K'  =>           1024 (KibiBytes)
          `MB' =>      1000*1000 (MegaBytes)
          `M'  =>      1024*1024 (MebiBytes)
          `GB' => 1000*1000*1000 (GigaBytes)
          `G'  => 1024*1024*1024 (GibiBytes)
     and so on for `T', `P', `E', `Z', and `Y'.

     Put into each output file as many complete lines of INPUT as
     possible without exceeding SIZE bytes.  Individual lines longer
     than SIZE bytes are broken into multiple files.  SIZE has the same
     format as for the `--bytes' option.

     Use suffixes of length LENGTH.  The default LENGTH is 2.

     Use digits in suffixes rather than lower-case letters.

     Write a diagnostic just before each output file is opened.

   An exit status of zero indicates success, and a nonzero value
indicates failure.