command function : Cutting files, cutting files in units of behavior or in bytes
command Syntax :
Split [–help][–version]
Split [-< line number >][-l < lines [file to be cut] [output FILENAME]
, in number of rows
Split [-B < byte >][-c < bytes] [file to cut] [output filename], in bytes
The output file name refers to the cut file as a prefix.
1. Cutting documents by unit of conduct
First create a file with 5 lines Hello,
#cat Hello
Hello, World1.
Hello, World2.
Hello, World3.
Hello, World4.
Hello, World5.
To use the command:
#split-2 Hello split1_
The split command cuts the file in two behavioral units, each of which consists of a new file, and 5 lines have three files, the names of which are:
Split1_aa, Split1_ab, Split_ac
2. Cutting in bytes
or file hello, using the command ls-l hello can see the file size is 65 bytes, to 10 byte cutting file, there will be 7 files
Use the-B command first, as follows:
#split-B Hello split2_
The file was cut out with 7,
Split2_aa, Split2_ab, Split2_ac, Split2_ad, Split2_ae, Split2_af, Split2_ag
The-c parameter is used below, as follows:
#split-C Hello split3_
10 files were cut out, with the ls-l command output as follows:
Although the same is done in bytes, the-c parameter keeps the integrity of each row as much as possible, that is, a row has 13 bytes, then it will be cut to two files, a 10 byte, a 3 byte, and the-B parameter will accumulate 8 bytes to the next line to make up 10 bytes and then cut, so the-b parameter only 7 files, The-c parameter has 10 files.