home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    


split [options ] [infile ] [outfile ]

Split infile into several files of equal length. infile remains unchanged, and the results are written to outfile aa , outfile ab , etc. (default is xaa , xab , etc.). If infile is - (or missing), standard input is read. See also csplit .


- n

Split infile into files, each n lines long (default is 1000).

Solaris Options

These options are unique to Solaris:

-a slen

Use slen characters for the filename suffix. Default is 2.

-b n [m ]

Split into pieces of size n bytes. An optional multiplier m may be supplied: k for kilobytes and m for megabytes. Mutually exclusive with -l .

-l n

Same as - n . Mutually exclusive with -b .


Break bigfile into 1000-line segments:



Join four files, then split them into ten-line files named new.aa , new.ab , etc. Note that without the - , new. would be treated as a nonexistent input file:

cat list[1-4] | split -10 - new.

Previous: Reference: spell UNIX in a Nutshell: System V Edition Next: Reference: srchtxt
Reference: spell Book Index Reference: srchtxt

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System