日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

7z压缩与解压命令

發(fā)布時(shí)間:2025/3/19 编程问答 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 7z压缩与解压命令 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

在寫很多工具的時(shí)候,可能會(huì)用到7z命令來進(jìn)行壓縮與解壓操作。這里記錄二個(gè)比較常用的操作:壓縮、解壓。

?

在dos窗口下輸入7z命令,會(huì)顯示7z的使用參數(shù)詳情:

7-Zip 9.10 beta? Copyright (c) 1999-2009 Igor Pavlov? 2009-12-22

Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
?????? [<@listfiles...>]

<Commands>
? a: Add files to archive
? b: Benchmark
? d: Delete files from archive
? e: Extract files from archive (without using directory names)
? l: List contents of archive
? t: Test integrity of archive
? u: Update files to archive
? x: eXtract files with full paths
<Switches>
? -ai[r[-|0]]{@listfile|!wildcard}: Include archives
? -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
? -bd: Disable percentage indicator
? -i[r[-|0]]{@listfile|!wildcard}: Include filenames
? -m{Parameters}: set compression Method
? -o{Directory}: set Output directory
? -p{Password}: set Password
? -r[-|0]: Recurse subdirectories
? -scs{UTF-8 | WIN | DOS}: set charset for list files
? -sfx[{name}]: Create SFX archive
? -si[{name}]: read data from stdin
? -slt: show technical information for l (List) command
? -so: write data to stdout
? -ssc[-]: set sensitive case mode
? -ssw: compress shared files
? -t{Type}: Set type of archive
? -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
? -v{Size}[b|k|m|g]: Create volumes
? -w[{path}]: assign Work directory. Empty path means a temporary directory
? -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
? -y: assume Yes on all queries

?

必選參數(shù):最常用的命令有a(壓縮)、x(解壓),其它的命令諸如刪除,解壓出來不保留目錄結(jié)構(gòu)這種,一般情況下都用不到。

可選參數(shù):最常用的就是-t{Type}

Type默認(rèn)值為7z,還有其它的如:

TypeFormatExample filename
-t7z7Zarchive.7z(默認(rèn))
-tgzipGZIParchive.gzip,archive.gz
-tzipZIParchive.zip(兼容)
-tbzip2BZIP2archive.bzip2
-ttarTARtarball.tar(Unix/Linux)
-tisoISOimage.iso(可能不支持)
-tudfUDFdisk.udf

常用的就是-t{Type}以及-r、-o、-y

?

解壓命令:7z x -tzip -y xx-13.zip (解壓到當(dāng)前目錄,如需改變輸出目錄,需要附加使用-o)

壓縮命令:7z a -tzip -r xx.zip a\* b\*

將目錄a、目錄b,壓縮成一個(gè)xx.zip

?

更多參數(shù)的詳情,可以參考這里:http://www.dotnetperls.com/7-zip-examples

?

在Windows的64位操作系統(tǒng)下,除需要7z.exe外,還需要7z.dll,我將他們打包為一個(gè)zip文件,否則你執(zhí)行命令的時(shí)候可能會(huì)遇到上面的錯(cuò)誤。你可以從這里直接下載>>

與50位技術(shù)專家面對(duì)面20年技術(shù)見證,附贈(zèng)技術(shù)全景圖

總結(jié)

以上是生活随笔為你收集整理的7z压缩与解压命令的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。