This article is written like a manual or guidebook. (June 2013) (Learn how and when to remove this template message)
|Initial release||February 1973|
|Operating system||Unix and Unix-like|
split is a utility on Unix and Unix-like operating systems most commonly used to split a computer file into two or more smaller files. The version of
split bundled in GNU coreutils was written by Torbjorn Granlund and Richard Stallman.
The command-syntax is:
split [OPTION] [INPUT [PREFIX]]
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. The files are typically rejoined using a utilitity such as cat.
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.
Split File into Pieces
Let’s assume we have file name with tuxlap.txt, Use below split command to break into the pieces
[root@AAMINE1965 ~]# split tuxlap.txt [root@AAMINE1965 ~]# ll total 32 -rw-------. 1 root root 980 Aug 12 00:11 anaconda-ks.cfg -rw-r--r--. 1 root root 9607 Nov 11 03:22 tuxlap.txt -rw-r--r--. 1 root root 8744 Nov 11 03:23 xaa -rw-r--r--. 1 root root 863 Nov 11 03:23 xab [root@AAMINE1965 ~]#
As we can see the above output ‘tuxlab.txt‘ is split into two pieces with the name ‘xaa’ and ‘xab’.
|This Unix-related article is a stub. You can help Wikipedia by expanding it.|