狂自私

导航

Windows下分卷压缩后到Linux进行解压的方法

windows 分卷压缩后 linux解压缩

 

Linux服务器在内网,中途隔了一层堡垒机。文件太大,堡垒机对此有限制,需要在Windows上分包,然后上送到Linux上进行合并解压。

我探索出来的办法有两个,以下依次介绍:

1、WinRAR+7za命令

WinRAR上需要选择压缩格式为zip,输入分卷大小:

 然后将分卷都传输到Linux上面:

[root@test1 20250523]# ll
总用量 68556
-rw-r--r-- 1 root root 10485760 5月  24 16:54 Grafana文档.z01
-rw-r--r-- 1 root root 10485760 5月  24 16:54 Grafana文档.z02
-rw-r--r-- 1 root root 10485760 5月  24 16:54 Grafana文档.z03
-rw-r--r-- 1 root root 10485760 5月  24 16:54 Grafana文档.z04
-rw-r--r-- 1 root root 10485760 5月  24 16:54 Grafana文档.z05
-rw-r--r-- 1 root root 10485760 5月  24 16:54 Grafana文档.z06
-rw-r--r-- 1 root root  4873087 5月  24 16:54 Grafana文档.zip

 

然后安装7za命令:

yum install p7zip -y

若是需要内网安装,可以下载离线安装包:

yumdownloader --resolve  p7zip
[root@test1 20250523]# yumdownloader --resolve  p7zip
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * centos-sclo-rh: ftp.sjtu.edu.cn
 * centos-sclo-sclo: ftp.sjtu.edu.cn
 * epel: mirror.nyist.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
--> 正在检查事务
---> 软件包 p7zip.x86_64.0.16.02-20.el7 将被 已重新安装
--> 解决依赖关系完成
p7zip-16.02-20.el7.x86_64.rpm                                                                                                                                                                                     | 605 kB  00:00:18
[root@test1 20250523]# ls *.rpm
p7zip-16.02-20.el7.x86_64.rpm
[root@test1 20250523]#

 

然后解压缩:

[root@test1 20250523]# 7za x Grafana文档.zip

7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (806EA),ASM,AES-NI)

Scanning the drive for archives:
1 file, 4873087 bytes (4759 KiB)

Extracting archive: Grafana文档.zip
--
Path = Grafana文档.zip
Type = zip
Physical Size = 4873087
Embedded Stub Size = 4
Total Physical Size = 67787647
Multivolume = +
Volume Index = 6
Volumes = 7
                                                                                                                                                                                                                                       Everything is Ok

Size:       71008659
Compressed: 67787647
[root@test1 20250523]# ls
Grafana文档.docx  

 

只需要将zip结尾的压缩文件附带到命令参数中即可。解压后得到的文件是可以正常使用的。

方法2:7Z.exe+7z命令

需要再Windows上面安装7Z压缩软件:

下载地址:https://www.7-zip.org/download.html

安装好之后,右键需要分卷的文件,选择添加到压缩文件,输入分卷大小:

 

然后上送到Linux服务器:

[root@test1 20250523]# ll Grafana文档*
-rw-r--r-- 1 root root 10485760 5月  24 17:04 Grafana文档.7z.001
-rw-r--r-- 1 root root 10485760 5月  24 17:04 Grafana文档.7z.002
-rw-r--r-- 1 root root 10485760 5月  24 17:04 Grafana文档.7z.003
-rw-r--r-- 1 root root 10485760 5月  24 17:04 Grafana文档.7z.004
-rw-r--r-- 1 root root 10485760 5月  24 17:04 Grafana文档.7z.005
-rw-r--r-- 1 root root 10485760 5月  24 17:04 Grafana文档.7z.006
-rw-r--r-- 1 root root  3809723 5月  24 17:04 Grafana文档.7z.007

安装7z命令:

sudo yum install p7zip p7zip-plugins -y

若需要离线安装,请下载离线安装包:

[root@test1 20250523]# yumdownloader --resolve  p7zip p7zip-plugins
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * centos-sclo-rh: ftp.sjtu.edu.cn
 * centos-sclo-sclo: ftp.sjtu.edu.cn
 * epel: mirror.nyist.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
--> 正在检查事务
---> 软件包 p7zip.x86_64.0.16.02-20.el7 将被 已重新安装
---> 软件包 p7zip-plugins.x86_64.0.16.02-20.el7 将被 已重新安装
--> 解决依赖关系完成
(1/2): p7zip-16.02-20.el7.x86_64.rpm                                                                                                                                                                              | 605 kB  00:00:15
(2/2): p7zip-plugins-16.02-20.el7.x86_64.rpm                                                                                                                                                                      | 969 kB  00:00:00
[root@test1 20250523]# ls *.rpm
p7zip-16.02-20.el7.x86_64.rpm  p7zip-plugins-16.02-20.el7.x86_64.rpm
[root@test1 20250523]#

然后解压缩:

[root@test1 20250523]# 7z x Grafana文档.7z.001

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (806EA),ASM,AES-NI)

Scanning the drive for archives:
1 file, 10485760 bytes (10 MiB)

Extracting archive: Grafana文档.7z.001
--
Path = Grafana文档.7z.001
Type = Split
Physical Size = 10485760
Volumes = 7
Total Physical Size = 66724283
----
Path = Grafana文档.7z
Size = 66724283
--
Path = Grafana文档.7z
Type = 7z
Physical Size = 66724283
Headers Size = 138
Method = LZMA2:24
Solid = -
Blocks = 1
                                                                                                                                                                                                                     Everything is Ok    
Size:       71008659
Compressed: 66724283
[root@test1 20250523]# ls *.docx
Grafana文档.docx
[root@test1 20250523]#

解压缩的时候也只需要将第一个文件附带到命令参数中。

 

posted on 2024-05-24 17:10  狂自私  阅读(23)  评论(0编辑  收藏  举报