UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: spellChapter 2
UNIX Commands
Next: Reference: srchtxt
 

split

split [option] [infile] [outfile]

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

Option

-n

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

Examples

Break bigfile into 1000-line segments:

split bigfile

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: spellUNIX in a Nutshell: System V EditionNext: Reference: srchtxt
Reference: spellBook IndexReference: 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