split (Unix)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

split is a Unix utility most commonly used to split a file into two or more smaller files.


The command-syntax is:


The default behavior of split is to generate output files of a fixed size, default 1000 lines. The files are named by appending aa, ab, ac, etc. to output filename. If output filename is not given, the default filename of x is used, for example, xaa, xab, etc. When a hyphen (-) is used instead of input filename, data is derived from standard input.

To split filename to parts each 50 MB named partaa, partab, partac,....

 split -b50m filename part

To join the files back together again use the cat command

 cat xaa xab xac > filename


 cat xa[a-c] > filename

or even

 cat xa? > filename

Additional program options permit a maximum character count (instead of a line count), a maximum line length, how many incrementing characters in generated filenames, and whether to use letters or digits.


See also

Retrieved from "https://en.wikipedia.org/w/index.php?title=Split_(Unix)&oldid=637558270"
This content was retrieved from Wikipedia : http://en.wikipedia.org/wiki/Split_(Unix)
This page is based on the copyrighted Wikipedia article "split (Unix)"; it is used under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC-BY-SA). You may redistribute it, verbatim or modified, providing that you comply with the terms of the CC-BY-SA