CentOS 中用 Split 命令分割文件的方法
2016-12-14 16:09
477 查看
CentOS 里切割大文件的命令如下:
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
generate suffixes of length N (default 2)
--additional-suffix=SUFFIX
append an additional SUFFIX to file names
-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[=FROM]
use numeric suffixes instead of alphabetic; FROM changes the start value (default 0)
-e, --elide-empty-files
do not generate empty output files with '-n'
--filter=COMMAND
write to shell COMMAND; file name is $FILE
-l, --lines=NUMBER
put NUMBER lines per output file
-n, --number=CHUNKS
generate CHUNKS output files; see explanation below
-u, --unbuffered
immediately copy input to output with '-n r/...'
--verbose
print a diagnostic just before each output file is opened
--help display this help and exit
--version
output version information and exit
常用选项说明如下:
-a : 指定后缀长度
-b : 每个文件多少字节
-d : 使用数字后缀而不是字母
-l : 指定每个文件的行数
比如我想让后缀长度为 2,即 -a 2。用数字后缀 -d。每个文件 10M,即 -b 10m。命令可以设计如下:
split -a 2 -d -b 10m /var/lib/mysql/general.log nowamagic
会在 /root 文件夹下生成下面的切割文件:
nowamagic00
nowamagic01
nowamagic02
nowamagic03
nowamagic04
nowamagic05
nowamagic06
nowamagic07
nowamagic08
nowamagic09
除了最后一个文件不是10M(有可能恰好10M,不过几率很小),其它都是。
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
generate suffixes of length N (default 2)
--additional-suffix=SUFFIX
append an additional SUFFIX to file names
-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[=FROM]
use numeric suffixes instead of alphabetic; FROM changes the start value (default 0)
-e, --elide-empty-files
do not generate empty output files with '-n'
--filter=COMMAND
write to shell COMMAND; file name is $FILE
-l, --lines=NUMBER
put NUMBER lines per output file
-n, --number=CHUNKS
generate CHUNKS output files; see explanation below
-u, --unbuffered
immediately copy input to output with '-n r/...'
--verbose
print a diagnostic just before each output file is opened
--help display this help and exit
--version
output version information and exit
常用选项说明如下:
-a : 指定后缀长度
-b : 每个文件多少字节
-d : 使用数字后缀而不是字母
-l : 指定每个文件的行数
比如我想让后缀长度为 2,即 -a 2。用数字后缀 -d。每个文件 10M,即 -b 10m。命令可以设计如下:
split -a 2 -d -b 10m /var/lib/mysql/general.log nowamagic
会在 /root 文件夹下生成下面的切割文件:
nowamagic00
nowamagic01
nowamagic02
nowamagic03
nowamagic04
nowamagic05
nowamagic06
nowamagic07
nowamagic08
nowamagic09
除了最后一个文件不是10M(有可能恰好10M,不过几率很小),其它都是。
相关文章推荐
- Linux(CentOS)用split命令分割文件的方法
- Linux(CentOS)用split命令分割文件
- Linux(CentOS)用split命令分割文件
- sort、uniq命令(可以对文本内容过滤除重)、split分割文件
- C#中用 Join方法和Split方法连接和分割字符串
- Linux命令-----文件分割与合并:split&cat
- linux大文件分割 split命令
- Linux命令学习之路---文件分割(split)命令
- linux大文件分割 split命令
- Linux 大文件分割split与合并cat使用方法
- Split命令分割分区的方法
- Linux系统下使用split命令分割大文件.txt
- 在Windows中合并Linux split命令分割的文件教程
- linux大文件分割 split命令
- linux大文件分割 split命令 - youxin
- split 命令 将文件分割成几段。
- split命令分割分区的方法
- “Linux文件的合并、排序和分割” 之 split 命令
- Linux的Split 命令 (文件分割)