Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default
size is 1000 lines, and default PREFIX is `x'. With no INPUT, or when INPUT
is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-a, --suffix-length=N use suffixes of length N (default 2)
-b, --bytes=SIZE put SIZE bytes per output file
-C, --line-bytes=SIZE put at most SIZE bytes of lines per output file
-d, --numeric-suffixes use numeric suffixes instead of alphabetic
-l, --lines=NUMBER put NUMBER lines per output file
--verbose print a diagnostic just before each
output file is opened
--help display this help and exit
--version output version information and exit
SIZE may be (or may be an integer optionally followed by) one of following:
KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
Report split bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
Report split translation bugs to <http://translationproject.org/team/>
For complete documentation, run: info coreutils 'split invocation'
功能说明:切割文件。
语 法:split [--help][--version][-<行数>][-b <字节>][-C <字节>][-l <行数>][要切割的文件][输出文件名]
补充说明:split可将文件切成较小的文件,预设每1000行会切成一个小文件。
参 数:
-<行数>或-l<行数> 指定每多少行就要切成一个小文件。
-b<字节> 指定每多少字就要切成一个小文件。支持单位:m,k
-C<字节> 与-b参数类似,但切割时尽量维持每行的完整性。
--help 显示帮助。
--version 显示版本信息。
[输出文件名] 设置切割后文件的前置文件名,split会自动在前置文件名后再加上编号。
例如:split -b 20m test.log test_part_
ls -lh
total 160M
-rw-rw-r-- 1 tcl_oss tcl_oss 80M Jul 17 13:51 test.log
-rw-rw-r-- 1 tcl_oss tcl_oss 20M Jul 17 13:53 test_part_aa
-rw-rw-r-- 1 tcl_oss tcl_oss 20M Jul 17 13:53 test_part_ab
-rw-rw-r-- 1 tcl_oss tcl_oss 20M Jul 17 13:53 test_part_ac
-rw-rw-r-- 1 tcl_oss tcl_oss 20M Jul 17 13:53 test_part_ad
使用cat test_part_* > test1.log合并文件
使用MD5SUM校验文件
表明合并以后的文件和拆分之前的文件是一样的,采用这种方式可以在文件较大时,分割进行传输;