阅读949 返回首页    go 阿里云 go 技术社区[云栖]


linux下分割和重组文件

    linux shell命令里的split和cat命令可以轻松完成这两个功能,举个例子来说,比如一个1GB大小的文件foo.zip,以100M为块分割:


    分割: split -b 100M -d foo.zip foo.zip.

    重组: cat foo.zip.?? > foo_same.zip


注意 -b中的 100M和100MB是有区别的,按照man的说法:

-b, --bytes=SIZE
              put SIZE bytes per output file

SIZE  is  an integer and optional unit (example: 10M is 10*1024*1024).
Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (pow‐
ers of 1000).


另外 -d是形成数字后缀而不是默认的阿拉伯字母后缀.

最后更新:2017-04-03 07:57:16

  上一篇:go java.util.concurrent包(5)——CountDownLatch使用
  下一篇:go c# 类、枚举的定义与使用