large file split command split :
The following list shows several command-line options that are most commonly used by this command:
| options |
description |
| -l |
Specifies the number of rows, each separated into a single file, with a default value of 1000 rows. |
| -b |
Specifies the number of bytes, supported by: K and M |
| -c |
similar to the-B parameter, but as much as possible to maintain the integrity of each row when cutting |
| -d |
|
/> Ls-l
-rw-r--r--. 1 root root 10530 Nov 23:08 test.tar.bz2
/> split-b 5k test.tar.bz2 #以每文件5k的大小切割test. tar.bz2
/> ls-l #查看切割后的结果, the file name is split by default in the following form.
-rw-r--r--. 1 root root 10530 Nov 23:08 test.tar.bz2
-rw-r--r--. 1 root root 5120 Nov 23:34 Xaa
-rw-r--r--. 1 root root 5120 Nov 23:34 xab
-rw-r--r--. 1 root root 290 Nov 23:34 xac
/> rm-f x*#删除拆分后的小文件
/> split-d-B 5k test.tar.bz2 #-d option to name the split small file after the suffix as a number
/> ls-l
-rw-r--r--. 1 root root 10530 Nov 23:08 test.tar.bz2
-rw-r--r--. 1 root root 5120 Nov 23:36 x00
-rw-r--r--. 1 root root 5120 Nov 23:36 x01
-rw-r--r--. 1 root root 290 Nov 23:36 x02
/> WC install.log-l #计算该文件的行数
/> split-l install.log #每300行拆分成一个小文件
/> ls-l x*
-rw-r--r--. 1 root root 11184 Nov 23:42 Xaa
-rw-r--r--. 1 root root 10805 Nov 23:42 xab
-rw-r--r--. 1 root root 12340 Nov 23:42 xac
-rw-r--r--. 1 root root 11783 Nov 23:42 xad
-rw-r--r--. 1 root root 2105 Nov 23:42 xae
Linux Command---Split