每天回顾linux命令(split)

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

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

root@62bf1a913608:/home/wzm/testsplit# ll redis.conf
-rw-r--r-- 1 root root 57764 Oct 30 15:14 redis.conf
root@62bf1a913608:/home/wzm/testsplit# ls
redis.conf
root@62bf1a913608:/home/wzm/testsplit# split  -b10240 redis.conf -d -a 10 redis.conf
root@62bf1a913608:/home/wzm/testsplit# ls
redis.conf            redis.conf0000000001  redis.conf0000000003  redis.conf0000000005
redis.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.conf
root@62bf1a913608:/home/wzm/testsplit# split -d -b10240 redis.conf
root@62bf1a913608:/home/wzm/testsplit# ls
redis.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.conf
root@62bf1a913608:/home/wzm/testsplit# split  -b10240 redis.conf
root@62bf1a913608:/home/wzm/testsplit# ls
redis.conf  xaa  xab  xac  xad  xae  xaf

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值