Split切割大日志文件

 
[admin@localhost ~]$ split --help
Usage: split [OPTION]... [INPUT [PREFIX]]
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/>
For complete documentation, run: info coreutils 'split invocation'
inux split 命令
  功能说明:切割文件。
  语  法:split [--help][--version][-<行数>][-b <字节>][-C <字节>][-l <行数>][要切割的文件][输出文件名]
  补充说明:split可将文件切成较小的文件,预设每1000行会切成一个小文件。
  参  数:
  -<行数>或-l<行数>  指定每多少行就要切成一个小文件。
  -b<字节>  指定每多少字就要切成一个小文件。支持单位:m,k
  -C<字节>  与-b参数类似,但切割时尽量维持每行的完整性。
  --help  显示帮助。
  --version  显示版本信息。
  [输出文件名]  设置切割后文件的前置文件名,split会自动在前置文件名后再加上编号。

使用例子: split -b 100m 1111.log (按照字节分隔) split -l 1000000 1111.log(按照行数分隔)