【linux】使用split命令拆分tar.gz 压缩包

操作步骤

(1)打包文件:
tar -cvf 20190816.tar 20190816

(2)分割文件:

#例子1
split -b 3G -d -a 1 20190816.tar 20190816.tar.
#例子2
split -b 40000K -d -a 1 go_1.7.tar.gz go_1.7.tar.gz.
# 例子3
split -b 40m -d -a 2 ISTP.tar ISTP.tar.

执行后的效果

-rw-r--r--  1 root     root      4194304000 May 20 14:00 cm-11.tar.gz.0
-rw-r--r--  1 root     root      4194304000 May 20 14:02 cm-11.tar.gz.1
-rw-r--r--  1 root     root      4194304000 May 20 14:03 cm-11.tar.gz.2
-rw-r--r--  1 root     root      4194304000 May 20 14:05 cm-11.tar.gz.3
-rw-r--r--  1 root     root      4194304000 May 20 14:06 cm-11.tar.gz.4
-rw-r--r--  1 root     root      4194304000 May 20 14:08 cm-11.tar.gz.5
-rw-r--r--  1 root     root      4194304000 May 20 14:09 cm-11.tar.gz.6
-rw-r--r--  1 root     root      2256379886 May 20 14:10 cm-11.tar.gz.7

参数解析
-b 3G 表示设置每个分割包的大小,单位还是可以k
-d "参数指定生成的分割包后缀为数字的形式
-a x来设定序列的长度(默认值是2),这里设定序列的长度为1

(3)合并分割后压缩包,并解压
cat 20190816.tar.* >new_20190816.tar
tar-xvf new_20190816.tar

split 命令详解

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 to standard error just
                            before each output file is opened
      --help     display this help and exit
      --version  output version information and exit

SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg.

-b 的参数可以是 数字,也可以是K (1 KB),或者m (1 mb)

例子3

split -b 40m -d -a 2 ISTP.tar ISTP.tar.

参考链接
https://blog.csdn.net/weixin_28755447/article/details/116555214

参考工具
字节计算器
https://calc.itzmx.com/

  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
您可以使用PyOpenGL库中的glu模块中的函数来导入obj模型。具体来说,您可以使用gluNewQuadric()函数创建一个新的四面体对象,然后使用gluQuadricDrawStyle()函数设置绘制样式,最后使用gluSphere()函数绘制球体。您还可以使用gluDeleteQuadric()函数删除四面体对象。以下是示例代码: ```python import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * def load_obj(filename): vertices = [] normals = [] texcoords = [] faces = [] for line in open(filename, "r"): if line.startswith('#'): continue values = line.split() if not values: continue if values[0] == 'v': vertices.append(map(float, values[1:4])) elif values[0] == 'vn': normals.append(map(float, values[1:4])) elif values[0] == 'vt': texcoords.append(map(float, values[1:3])) elif values[0] == 'f': face = [] texcoords = [] norms = [] for v in values[1:]: w = v.split('/') face.append(int(w[0])) if len(w) >= 2 and len(w[1]) > 0: texcoords.append(int(w[1])) else: texcoords.append(0) if len(w) >= 3 and len(w[2]) > 0: norms.append(int(w[2])) else: norms.append(0) faces.append((face, norms, texcoords)) return vertices, normals, texcoords, faces def draw_obj(vertices, normals, texcoords, faces): glBegin(GL_TRIANGLES) for face in faces: face_vertices, face_normals, face_texcoords = face for i in range(3): if normals: glNormal3fv(normals[face_normals[i] - 1]) if texcoords: glTexCoord2fv(texcoords[face_texcoords[i] - 1]) glVertex3fv(vertices[face_vertices[i] - 1]) glEnd() def main(): pygame.init() display = (800, 600) pygame.display.set_mode(display, DOUBLEBUF | OPENGL) gluPerspective(45, (display[0] / display[1]), 0.1, 50.0) glTranslatef(0.0, 0.0, -5) obj_vertices, obj_normals, obj_texcoords, obj_faces = load_obj("model.obj") while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() quit() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) draw_obj(obj_vertices, obj_normals, obj_texcoords, obj_faces) pygame.display.flip() pygame.time.wait(10) if __name__ == '__main__': main() ``` 希望这可以帮助您!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Bug 挖掘机

支持洋子

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值