7z压缩软件怎么用 免费解压软件推荐

7-Zip是一个文件归档器,支持7z(它实现了压缩比非常高的LZMA压缩算法)、LZMA2、XZ、Zip、Zip***、CAB、ARJ、GZIP、BZIP2、TAR、CPIO、RPM、ISO、大多数文件系统映像和DEB格式。RAR格式已被删除,因为它不是一个自由许可证。环境Centos7.7 Mini***lp7zip-16.02安装Centos7中默...

7-Zip是一个文件归档器,支持7z(它实现了压缩比非常高的LZMA压缩算法)、LZMA2、XZ、Zip、Zip***、CAB、ARJ、GZIP、BZIP2、TAR、CPIO、RPM、ISO、大多数文件系统映像和DEB格式。RAR格式已被删除,因为它不是一个自由许可证。

环境

Centos7.7 Mini***lp7zip-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 [***] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,*** bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)Scanning the drive:4 files, 0 bytesCreating archive: files.7zItems to compress: 4 Files read from disk: 0Archive size: 143 bytes (1 KiB)Everything is Ok

执行该命令后,检查是否创建了7z格式的压缩包。

创建包含目录的压缩包:

[root@localhost ~]# 7z a gpg.7z .gnupg/7-Zip [***] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,*** 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.7zItems to compress: 7 Files read from disk: 2Archive size: 4157 bytes (5 KiB)Everything is Ok[root@localhost ~]#

7zip还可以压缩和解压缩其他格式的压缩包。例如,在中创建一个压缩包。zip格式。

[root@localhost ~]# 7z a files.zip file{1..4}.txt7-Zip [***] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,*** bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)Scanning the drive:4 files, 0 bytesCreating archive: files.zipItems to compress: 4 Files read from disk: 4Archive size: 542 bytes (1 KiB)Everything is Ok

列出压缩包的内容

使用l参数列出压缩包的内容:

[root@localhost ~]# 7z l gpg.7z 7-Zip [***] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,*** 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.7zType = 7zPhysical Size = 4157Headers Size = 278Method = LZMA2:12kSolid = +Blocks = 1 Date Time Attr Size Compressed Name------------------- ----- ------------ ------------ ------------------------2020-01-04 18:24:05 D.... 0 0 .gnupg2020-01-04 18:22:36 D.... 0 0 .gnupg/private-keys-v1.d2020-01-04 18:24:48 ....A 0 0 .gnupg/S.gpg-agent2020-01-04 18:22:36 ....A 0 0 .gnupg/pubring.gpg2020-01-04 18:24:05 ....A 0 0 .gnupg/secring.gpg2020-01-04 18:22:36 ....A 7680 3879 .gnupg/gpg.conf2020-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 [***] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,*** 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.7zType = 7zPhysical Size = 4157Headers Size = 278Method = LZMA2:12kSolid = +Blocks = 1Everything is OkFolders: 2Files: 5Size: 8280Compressed: 4157

您可以看到所有文件都被提取到当前目录。

现在用x参数解压文件,看看。

[root@localhost test]# 7z x gpg.7z 7-Zip [***] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,*** 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.7zType = 7zPhysical Size = 4157Headers Size = 278Method = LZMA2:12kSolid = +Blocks = 1Everything is OkFolders: 2Files: 5Size: 8280Compressed: 4157

可以看到提取的文件是按照原始文件的目录形式提取的。

更新压缩包

一段时间后,你需要在文件夹中添加一些新文件,你想把它们添加到压缩包中。您只需要更新现有的压缩包,而不是创建新的压缩包。

首先压缩测试目录。

[root@localhost test]# 7z a files.7z test/7-Zip [***] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,*** bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)Scanning the drive:1 folder, 4 files, 0 bytesCreating archive: files.7zItems to compress: 5 Files read from disk: 0Archive size: 158 bytes (1 KiB)Everything is Ok

在测试文件夹中创建几个文件,然后更新压缩包:

[root@localhost test]# touch test/file{5..10}.txt[root@localhost test]# 7z u files.7z test/7-Zip [***] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,*** bits,1 CPU Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (906EA),ASM,AES-NI)Open archive: files.7z--Path = files.7zType = 7zPhysical Size = 158Headers Size = 158Solid = -Blocks = 0Scanning the drive:1 folder, 10 files, 0 bytesUpdating archive: files.7zItems to compress: 7 Files read from disk: 0Archive size: 186 bytes (1 KiB)Everything is Ok

检查文件是否已被添加。

[root@localhost test]# 7z l files.7z 7-Zip [***] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,*** 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.7zType = 7zPhysical Size = 186Headers Size = 186Solid = -Blocks = 0 Date Time Attr Size Compressed Name------------------- ----- ------------ ------------ ------------------------2020-03-11 14:24:54 D.... 0 0 test2020-03-11 14:18:22 ....A 0 0 test/file1.txt2020-03-11 14:24:54 ....A 0 0 test/file10.txt2020-03-11 14:18:22 ....A 0 0 test/file2.txt2020-03-11 14:18:22 ....A 0 0 test/file3.txt2020-03-11 14:18:22 ....A 0 0 test/file4.txt2020-03-11 14:24:54 ....A 0 0 test/file5.txt2020-03-11 14:24:54 ....A 0 0 test/file6.txt2020-03-11 14:24:54 ....A 0 0 test/file7.txt2020-03-11 14:24:54 ....A 0 0 test/file8.txt2020-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%。

本文来自语死早数已亡投稿,不代表舒华文档立场,如若转载,请注明出处:https://www.chinashuhua.cn/24/632530.html

打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
() 0
上一篇 07-13
下一篇 07-13

相关推荐

  • 360压缩怎么压缩图片

    1、按原文件的大小而定,一般1G的东西只压缩了一两百MB,基本忽略不计,如果硬盘太小最好还是换个大点的;可以使用PS把图片缩小,具体的操作方法和步骤如下1第一步,打开PS软件,然后打开要在PS中处理的图片,如下图所示,然后进入下一步2其次,完成上述步骤后,按快捷键“ C

    2023-07-29 00:16:01
    1046 0
  • gif压缩工具有哪些 公认最好的4款压缩工具

    朋友们经常在群里问,有什么有用的视频转换成gif的工具吗?有没有好用的把屏幕录制成GIF的工具?这时候小美就会抛出以下工具,基本可以满足绝大多数Mac和PC用户。可以从文件、录屏、修改、压缩等主要方面来打理。来看看吧~◆ ◇ ◆GIF啤酒厂马科斯30.00元GIF Brewery应该是Ma

    2023-07-28 07:21:01
    1039 0
  • win解压缩软件推荐 电脑解压文件压缩包rar的方法

    压缩/解压软件可以说是电脑上最不可或缺的工具之一。WinZip /2345压缩/360压缩一直占据着无数人的桌面,功能还可以,除了不注意会有附加软件,让人很烦。其次,趁你不注意的时候弹出窗口,绑定他家浏览器主页之类的,说不定还会推荐那种乱七八糟的新闻之类的。所以今天我推荐

    2023-07-28 01:37:01
    669 0
  • 压缩文件成zip格式教程

    1将准备压缩的文件,全部收纳到一个文件夹内在该文件夹下,点击右键选择新建ZIP压缩文件按钮点击新建ZIP文件后,在当前文件夹下创建了一个空的ZIP文件2我们双击打开这个ZIP文件,在文件界面点击添加按钮点击添加;WinRAR基本上是每台电脑的必备软件,主要用于压缩文件和解压文

    2023-07-27 01:08:01
    793 0

评论列表

联系我们

在线咨询: QQ交谈

邮件:admin@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信