Splits a file into pieces.
split [ -l LineCount ] [ -a SuffixLength ] [ File [ Prefix ] ]
split -b Number [ k | m ] [ -a SuffixLength ] [ File [ Prefix ] ]
The split command reads the specified file and writes it in 1000-line pieces to a set of output files. The name of the first output file is constructed by combining the specified prefix (x by default) with the aa suffix, the second by combining the prefix with the ab suffix, and so on lexicographically through zz (a maximum of 676 files). The number of letters in the suffix, and consequently the number of output name files, can be increased by using the -a flag.
You cannot specify a Prefix longer than PATH_MAX - 2 bytes (or PATH_MAX - SuffixLength bytes if the -a flag is specified). The PATH_MAX variable specifies the maximum path-name length for the system as defined in the /usr/include/sys/limits.h file.
If you do not specify an input file or if you specify a file name of - (minus sign), the split command reads standard input.
Note: The -b and -l flags are mutually exclusive.
|-a SuffixLength||Specifies the number of letters to use in forming the suffix portion of the output name files. The number of letters determines the number of possible output filename combinations. The default is two letters.|
|-b Number||Splits the file into the number of bytes specified by the Number variable. Adding the k (kilobyte) or m (megabyte) multipliers to the end of the Number value causes the file to be split into Number*1024 or Number*1,048,576 byte pieces, respectively.|
|-l LineCount||Specifies the number of lines in each output file. The default is 1000 lines.|
This command returns the following exit values:
|0||The command ran successfully.|
|>0||An error occurred.|
split bookThis example splits book into 1000-line segments named xaa , xab , xac , and so forth.
split -l 50 book sectThis example splits book into 50-line segments named sectaa , sectab , sectac , and so forth.
split -b 2k bookThis example splits the book into 2*1024-byte segments named xaa , xab , xac , and so forth.
split -l 5 -a 3 book sectThis example splits a book into 5-line segments named sectaaa , sectaab , sectaac , and so forth, up to sectzzz (a maximum of 17,576 files).
|/usr/bin/split||Contains the split command.|
The csplit command.
Files Overview in AIX Version 4.3 System User's Guide: Operating System and Devices.
Input and Output Redirection Overview in AIX Version 4.3 System User's Guide: Operating System and Devices.