[etl5@biserver04 ~]$man split
SPLIT(1) User Commands SPLIT(1)
NAME
split - split a file into pieces
SYNOPSIS
split [OPTION]... [INPUT [PREFIX]]
DESCRIPTION
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.
AUTHOR
Written by Torbjorn Granlund and Richard M. Stallman.
split -l 3123301d060098.avl -d -a 2 /home/data/060098.avl.
split -C 1024m/home/data/d060098.avl -d -a 2 /home/data/tmp/060098.avl.
-C:
put at most SIZE bytes of lines per output file 按照大小拆分,确保行数不会截断。
效率上面:
按照行数拆分文件,速度比较慢
按照大小拆分,速度稍微快点