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.
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.