Ubuntu(linux) 7z压缩和解压缩命令

环境

  • HOST OS:Ubuntu 20.04.4 on VMware

内容

安装
sudo apt install p7zip

安装后输入以下命令,得到版本信息确认安装成功

7zr

image-20220730085852854

Usage: 7za […] <archive_name> [<file_names>…]
[<@listfiles…>]

a : Add files to archive b : Benchmark d : Delete files from archive e : Extract files from archive (without using directory names) h : Calculate hash values for files i : Show information about supported formats l : List contents of archive rn : Rename files in archive t : Test integrity of archive u : Update files to archive x : eXtract files with full paths
压缩命令

将files文件夹和其下的2个文件压缩为a.7z

7zr a a.7z files/

image-20220730092937894

解压缩命令

将a.7z解压缩到当前文件夹

7zr x a.7z

image-20220730093119290

参考

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐