2、压缩
7z 压缩命令 : 将本目录压缩到 string.7z 压缩包中 , 压缩等级设置为极限压缩 ;
7z a string.7z . -mx=9
命令行输出 :
D:\develop\7zip>7z a string.7z . -mx=9 7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21 Scanning the drive: 1 file, 23361 bytes (23 KiB) Creating archive: string.7z Add new data to archive: 1 file, 23361 bytes (23 KiB) Files read from disk: 1 Archive size: 5438 bytes (6 KiB) Everything is Ok D:\develop\7zip>
压缩结果 : 23KB 的 XML 文本文件被压缩层 6KB ;
3、解压缩
7z 解压缩命令 : 将 string.7z 解压 , 输出到 output 目录中 ;
7z x string.7z -ooutput
命令行输出 :
D:\develop\7zip>7z x string.7z -ooutput 7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21 Scanning the drive for archives: 1 file, 5438 bytes (6 KiB) Extracting archive: string.7z -- Path = string.7z Type = 7z Physical Size = 5438 Headers Size = 130 Method = LZMA2:24k Solid = - Blocks = 1 Everything is Ok Size: 23361 Compressed: 5438 D:\develop\7zip>
解压结果 : string.7z 解压到了 output 目录中 ;
四、参考资料
参考资料 :
7-Zip 官网 : https://www.7-zip.org/