7z压缩软件怎么用(免费解压软件推荐)
7-Zip是一个支持7z(它实现了LZMA压缩算法,具有非常高的压缩比)、LZMA2、XZ、ZIP、Zip64、CAB、ARJ、GZIP、BZIP2、TAR、CPIO、RPM、ISO、大多数文件系统映像和DEB格式的文件归档器。RAR格式由于不是免费许可,已经被删除了。
环境
Centos7.7 Minimal
p7zip-16.02
安装
默认Centos7没有安装p7zip安装包,默认源里面也没有这个安装包,需要安装epel源才能安装p7zip安装包。
[root@localhost ~]# yum -y install epel-release
[root@localhost ~]# yum -y install p7zip p7zip-plugins
使用方法
7z命令提供的函数字母与命令行选项类似,但使用时不使用-。这些参数字母告诉命令它需要执行的函数。
压缩文件
创建一个压缩包使用a参数
创建一个7z格式的压缩包:
[root@localhost ~]# 7z a files.7z file1.txt file2.txt file3.txt file4.txt
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)
Scanning the drive:
4 files, 0 bytes
Creating archive: files.7z
Items to compress: 4
Files read from disk: 0
Archive size: 143 bytes (1 KiB)
Everything is Ok
执行完命令,查看一下是否已经创建7z格式的压缩包
创建一个包含目录的压缩包:
[root@localhost ~]# 7z a gpg.7z .gnupg/
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)
Scanning the drive:
2 folders, 5 files, 8280 bytes (9 KiB)
Creating archive: gpg.7z
Items to compress: 7
Files read from disk: 2
Archive size: 4157 bytes (5 KiB)
Everything is Ok
[root@localhost ~]#
7zip还可以压缩、解压缩其他格式的压缩包。比如:创建一个.zip格式的压缩包。
[root@localhost ~]# 7z a files.zip file{1..4}.txt
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)
Scanning the drive:
4 files, 0 bytes
Creating archive: files.zip
Items to compress: 4
Files read from disk: 4
Archive size: 542 bytes (1 KiB)
Everything is Ok
列出压缩包里面的内容
列出压缩包的内容使用l参数:
[root@localhost ~]# 7z l gpg.7z
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)
Scanning the drive for archives:
1 file, 4157 bytes (5 KiB)
Listing archive: gpg.7z
--
Path = gpg.7z
Type = 7z
Physical Size = 4157
Headers Size = 278
Method = LZMA2:12k
Solid = +
Blocks = 1
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2020-01-04 18:24:05 D.... 0 0 .gnupg
2020-01-04 18:22:36 D.... 0 0 .gnupg/private-keys-v1.d
2020-01-04 18:24:48 ....A 0 0 .gnupg/S.gpg-agent
2020-01-04 18:22:36 ....A 0 0 .gnupg/pubring.gpg
2020-01-04 18:24:05 ....A 0 0 .gnupg/secring.gpg
2020-01-04 18:22:36 ....A 7680 3879 .gnupg/gpg.conf
2020-01-04 18:24:52 ....A 600 .gnupg/random_seed
------------------- ----- ------------ ------------ ------------------------
2020-01-04 18:24:52 8280 3879 5 files, 2 folders
解压文件
使用e来解压文件,解压所有文件到当前目录。(不推荐使用)
[root@localhost test]# 7z e gpg.7z
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)
Scanning the drive for archives:
1 file, 4157 bytes (5 KiB)
Extracting archive: gpg.7z
--
Path = gpg.7z
Type = 7z
Physical Size = 4157
Headers Size = 278
Method = LZMA2:12k
Solid = +
Blocks = 1
Everything is Ok
Folders: 2
Files: 5
Size: 8280
Compressed: 4157
可以看到所有文件都解压到当前目录了。
现在使用x参数解压文件看一下。
[root@localhost test]# 7z x gpg.7z
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)
Scanning the drive for archives:
1 file, 4157 bytes (5 KiB)
Extracting archive: gpg.7z
--
Path = gpg.7z
Type = 7z
Physical Size = 4157
Headers Size = 278
Method = LZMA2:12k
Solid = +
Blocks = 1
Everything is Ok
Folders: 2
Files: 5
Size: 8280
Compressed: 4157
可以看到解压出来的文件,按照原来文件的目录形式解压出来的。
更新压缩包
一段时间之后,需要将一些新文件添加到文件夹中,并且希望将他们添加到压缩包里面,可以不用创建一个新的压缩包,只需要更新现有的压缩包就可以。
首先将test目录压缩
[root@localhost test]# 7z a files.7z test/
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)
Scanning the drive:
1 folder, 4 files, 0 bytes
Creating archive: files.7z
Items to compress: 5
Files read from disk: 0
Archive size: 158 bytes (1 KiB)
Everything is Ok
在test文件夹中创建几个文件,然后再更新压缩包:
[root@localhost test]# touch test/file{5..10}.txt
[root@localhost test]# 7z u files.7z test/
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)
Open archive: files.7z
--
Path = files.7z
Type = 7z
Physical Size = 158
Headers Size = 158
Solid = -
Blocks = 0
Scanning the drive:
1 folder, 10 files, 0 bytes
Updating archive: files.7z
Items to compress: 7
Files read from disk: 0
Archive size: 186 bytes (1 KiB)
Everything is Ok
查看一下是否已经添加文件。
[root@localhost test]# 7z l files.7z
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)
Scanning the drive for archives:
1 file, 186 bytes (1 KiB)
Listing archive: files.7z
--
Path = files.7z
Type = 7z
Physical Size = 186
Headers Size = 186
Solid = -
Blocks = 0
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2020-03-11 14:24:54 D.... 0 0 test
2020-03-11 14:18:22 ....A 0 0 test/file1.txt
2020-03-11 14:24:54 ....A 0 0 test/file10.txt
2020-03-11 14:18:22 ....A 0 0 test/file2.txt
2020-03-11 14:18:22 ....A 0 0 test/file3.txt
2020-03-11 14:18:22 ....A 0 0 test/file4.txt
2020-03-11 14:24:54 ....A 0 0 test/file5.txt
2020-03-11 14:24:54 ....A 0 0 test/file6.txt
2020-03-11 14:24:54 ....A 0 0 test/file7.txt
2020-03-11 14:24:54 ....A 0 0 test/file8.txt
2020-03-11 14:24:54 ....A 0 0 test/file9.txt
------------------- ----- ------------ ------------ ------------------------
2020-03-11 14:24:54 0 0 10 files, 1 folders
总结
7z格式的压缩比例比ZIP格式的压缩比例高30%-50%。
-
无相关信息
- 1bat的大数据(BAT的大数据来源)
- 2三星s8屏幕上端2(三星s8屏幕上端2个按键)
- 3三星屏幕坏了如何导出(三星屏幕摔坏了如何导出数据么)
- 4红米3x怎么关闭自动更新(红米k40s怎么关闭自动更新)
- 5微信上防止app自动下载软件怎么办(微信上防止app自动下载软件怎么办啊)
- 6押镖多少钱(押镖一个月有多少储备金)
- 7瑞星个人防火墙胡功能(瑞星个人防火墙协议类型有哪些)
- 8cf现在等级是多少(cf等级2020最新)
- 9老滑头多少条鱼(钓鱼老滑头有什么用)
- 10WPS自动调整语法(wps如何修改语法)
- 11dell控制面板防火墙(dell的防火墙怎么关闭)
- 12丑女技能升多少(丑女技能需要满级吗)
- 13智能家居系统怎么样(智能家居系统好吗)
- 14戴尔屏幕(戴尔屏幕闪烁)
- 15y85屏幕信息(vivoy85息屏显示时间怎么设置)
- 16魅蓝note3屏幕出现方格(魅蓝note屏幕竖条纹)
- 17v8手指按屏幕(触屏手指)
- 18金为液晶广告机(液晶广告机lb420)
- 19三星显示器怎么校色(三星显示器 调色)
- 20hkc显示器dvi音频(hkc显示器有音响么)
- 21康佳液晶智能电视机(康佳液晶智能电视机怎么样)
- 22做液晶画板电脑(做液晶画板电脑怎么操作)
- 23液晶屏极化现象原理(液晶屏极化现象原理是什么)
- 24企业网络安全防火墙(企业网络防护)
- 256splus黑屏屏幕不亮(苹果6s plus屏幕突然黑屏)
- 26充电导致屏幕失灵(充电导致屏幕失灵怎么办)
- 27超极本屏幕旋转(笔记本电脑屏幕旋转,怎么转过来?)
- 28igmp防火墙(防火墙配置ipv6)
- 29荣耀王者多少经验(王者荣耀经验多少一级)
- 30lol老将还剩多少(qg老将)