O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

split

Synopsis

split [option] [infile] [outfile]

Splits infile into equal-sized segments. infile remains unchanged, and the results are written to outfile aa, outfile ab, and so on. (Default is xaa, xab, etc.). If infile is (or missing and default outfile is used), standard input is read.

Options

- n, -l n

Split infile into n-line segments (default is 1000).

-b n[km]

Split infile into n-byte segments. Alternate blocksizes may be specified:

k

1 kilobyte

m

1 megabyte

-

Take input from the standard input.

Examples

Break bigfile into 1000-line segments:

$ split bigfile

Join four files, then split them into 10-line files named new.aa, new.ab, and so on. Note that without the -, new. is as a nonexistent input file:

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required