Introduction
Split can split a large file into multiple files of a specified size, and the split speed is very fast, splitting a 1G size file takes less than 1S of time, and if you manually perform operations on Windows, the estimate is stuck.
Options
usage:split [OPTION] ... [INPUT [PREFIX]] Outputfixed-size pieces of INPUT to Prefixaa, Prefixab, ...;defaultsize is +Lines, anddefaultPREFIX is' X'. With no input, or when input is-, read standard input. Mandatory arguments toLongOptions are mandatory for Shortoptions too. -A,--suffix-length=n use suffixes of length N (default 2) Specifies the suffix length of the split file-B,--bytes=size put size bytes per output file split by byte, default unit byte-C,--line-bytes=size put at bytes of lines per output file specifies the maximum size of a single row, the default unit byte-D,--numeric-suffixes use numeric suffixes instead of alphabetic with numbers as suffixes of the split file-L,--lines=numbers put number lines per output file is split by rows--verbose print a diagnostic just before each output file isopened--help Display ThisHelp and exit--version output version information and exitsize May is (or may be a integer optionally followed by) one of the following : KB +K1024x768, MB +* +M1024x768*1024x768, and so on forG, T, P, E, Z, Y. You can specify other units with a suffix report split bugs to Bug-[Email Protected]gnu coreutils home page://www.gnu.org/software/coreutils/>General HelpusingGNU Software: //www.gnu.org/gethelp/>For complete documentation, Run:info coreutils'Split Invocation'
Instance
[Email protected] test]# more TESTABCDEFG
1. Splitting according to row
Each 3 lines are split into a file, the split file name begins with a name, and a number is the suffix suffix length of 1
3 1 Name
[email protected] test]# lltotal --rw-r--r--.1Root root6Oct9 +: ANAME0-rw-r--r--.1Root root6Oct9 +: Aname1-rw-r--r--.1Root root2Oct9 +: Aname2-rw-r--r--.1Root root -Oct9 +: -Test
2. Split by Byte
Every three bytes split into a file, by default, no unit is byte, can also take units such as KB,MB, etc.
3 1 New
[Email protected] test]# ls-lNew*-rw-r--r--.1Root root3Oct9 +: -new0-rw-r--r--.1Root root3Oct9 +: -New1-rw-r--r--.1Root root3Oct9 +: -New2-rw-r--r--.1Root root3Oct9 +: -NEW3-rw-r--r--.1Root root2Oct9 +: -New4
Summary
The Spit command is useful, for example, when importing data, splitting a file into concurrent import is much faster.
Note: pursuer.chen Blog:http://www.cnblogs.com/chenmh This site all the essays are original, welcome to reprint, but reprint must indicate the source of the article, and at the beginning of the article clearly give the link. Welcome to the exchange of discussions |
Linux Split split file