每天回顾linux命令(split)

来源:互联网 发布:centos解压war包 编辑:程序博客网 时间:2024/06/04 23:32

split命令
split命令可以将一个大文件分割成很多个小文件,有时需要将文件分割成更小的片段,比如提高可读性,生成日志等。

选项
-a:表名文件后缀的大小,默认为2

root@62bf1a913608:/home/wzm/testsplit# ll redis.conf-rw-r--r-- 1 root root 57764 Oct 30 15:14 redis.confroot@62bf1a913608:/home/wzm/testsplit# lsredis.confroot@62bf1a913608:/home/wzm/testsplit# split  -b10240 redis.conf -d -a 10 redis.confroot@62bf1a913608:/home/wzm/testsplit# lsredis.conf            redis.conf0000000001  redis.conf0000000003  redis.conf0000000005redis.conf0000000000  redis.conf0000000002  redis.conf0000000004

-b:为每个文件档案的大小,单位为字节。

root@62bf1a913608:/home/wzm/testsplit# ll redis.conf-rw-r--r-- 1 root root 57764 Oct 30 15:14 redis.confroot@62bf1a913608:/home/wzm/testsplit# split -d -b10240 redis.confroot@62bf1a913608:/home/wzm/testsplit# lsredis.conf  x00  x01  x02  x03  x04  x05

-c:每一输出档中,单行的最大byte数
-d:使用数字作为后缀,如-b例子,没加-d如下:

root@62bf1a913608:/home/wzm/testsplit# ll redis.conf-rw-r--r-- 1 root root 57764 Oct 30 15:14 redis.confroot@62bf1a913608:/home/wzm/testsplit# split  -b10240 redis.confroot@62bf1a913608:/home/wzm/testsplit# lsredis.conf  xaa  xab  xac  xad  xae  xaf

-l:没一输出档的列数大小。以行数分割文件。

原创粉丝点击