解压 tar 文件
[root@liqiang.io]# tar -xf prometheus.tar
[root@liqiang.io]# tar -xf prometheus.tar -C /tmp/prometheus # 指定解压目录
[root@liqiang.io]# tar -zxf prometheus.tar.gz # gzip 类型
[root@liqiang.io]# tar -zxvf prometheus.tar.gz # 查看解压过程
打包 tar 文件
[root@liqiang.io]# tar -cf prometheus.tar /etc/prometheus # 普通打包
[root@liqiang.io]# tar -cf prometheus.tar /etc/prometheus /usr/bin/prometheus # 多个文件
[root@liqiang.io]# tar -zcf prometheus.tar.gz /etc/prometheus # 带 gzip 压缩
[root@liqiang.io]# tar -zcvf prometheus.tar.gz /etc/prometheus # 查看打包过程
分割 tar 包
[root@liqiang.io]# split -b 1024M -d -a 1 prometheus.tar.gz prometheus.tar.gz.
-b 1024M
:每个分割文件为 1024 M-a 1
:后缀为数字 1 开始prometheus.tar.gz.
:分割的数据包的前缀名
分割后的解压
[root@liqiang.io]# cat prometheus.tar.gz.* | tar -zx