Android 台灣中文網

打印 上一主題 下一主題

[分享] 7-Zip 教學 大家參考看看(有修改內容 紅色部份) -5

[複製連結] 查看: 11|回覆: 0|好評: 0
跳轉到指定樓層
樓主
old2009 | 收聽TA | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
發表於 2026-1-28 06:51

馬上加入Android 台灣中文網,立即免費下載應用遊戲。

您需要 登錄 才可以下載或查看,沒有帳號?註冊

x
mt=[off | on | {N}]
Sets multithread mode. If you have a multiprocessor or multicore system, you can get a in-crease with this switch. 7-Zip supports multithread mode only for LZMA / LZMA2 compres-sion and BZip2 compression / decompression. If you specify {N}, for example mt=4, 7-Zip tries to use 4 threads. LZMA compression uses only 2 threads.

設置多執行緒模式。如果您擁有多處理器或多核心系統,您可以通過此開關獲得增益。7-Zip 僅支持 LZMA / LZMA2 壓縮和 BZip2 壓縮 / 解壓縮的多執行緒模式。如果您指定 {N},例如 mt=4,7-Zip 嘗試使用 4 個執行緒。LZMA 壓縮僅使用 2 個執行緒.
在搜尋列 輸入 cmd 以系統管理員身份執行  
輸入 wmic  再輸入cpu get NumberOfLogicalProcessors  就可以看到你的執行緒是幾個

C:\Windows\system32>wmic
wmic:root\cli>cpu get NumberOfLogicalProcessors


NumberOfLogicalProcessors
4 (4 個執行緒) 我的電腦是4個執行緒

參數設 mt=4


                               
登錄/註冊後可看大圖



............................................................................................

mtf=[off | on] 預設是on

Set multithreading mode for filters. 為過濾器設置多線程模式(電腦有幾個執行緒)。


mtf=on mt=4


                               
登錄/註冊後可看大圖



                               
登錄/註冊後可看大圖


...........................................................................................................




tm=[off | on] 預設是on

Stores last Modified timestamps for files. 儲存檔案的最後修改時間戳記。


tc=[off | on] 預設是off  

Stores Creation timestamps for files. 儲存檔案的創建時間戳。


ta=[off | on] 預設是off  儲存檔案的最後訪問時間戳。


tr=[off | on] 預設是on  存儲文件屬性。
{N}={MethodID}[:param1][:param2][..]    param參數
例子:{N}={MethodID} 格式
1. 選擇壓縮方法(-m0)
•    {N}:m0
•    {MethodID}:壓縮方法,例如 LZMA、LZMA2、PPMD、BZIP2 等。
•    這個選項告訴7-Zip選擇使用某種壓縮方法來進行文件壓縮。例如:
7z a archive.7z *.txt -m0=LZMA

2. 設定解壓方法(-m1)
在某些情況下,你也可以指定解壓縮方法,或者是用於不同的壓縮檔案的解壓方式。這通常是在一些特定的解壓或檔案處理操作中使用。
如果解壓一個 .tar 壓縮文件:
7z x archive.tar -m1=Copy



這裡是一些常見的 {ParamName}={ParamValue} 參數及其說明:
1. 壓縮方法 (-m0)
•    ParamName:m0
•    ParamValue:壓縮方法名稱,例如 LZMA、LZMA2、PPMD 等。
-m0=LZMA2

2. 壓縮級別 (-mx)
•    ParamName:mx
•    ParamValue:壓縮級別,範圍從 0(無壓縮)到 9(最大壓縮)
3. 加密 (-p)
•    ParamName:p
•    ParamValue:密碼。如果設置了密碼,7-Zip將加密文件。
4. 分卷壓縮 (-v)
•    ParamName:v
•    ParamValue:每個分卷的大小,例如 10m 表示每個分卷 10MB。
壓縮文件格式 (-t)
•    ParamName:t
•    ParamValue:壓縮格式(例如 7z, zip, tar 等)。
6. 文件名模式 (-r)
•    ParamName:r


MF_ID    Dictionary    Memory Us-age    Description
bt2        9.5 * d    + 4 MB    Binary Tree    2 bytes hashing
bt3        11.5 * d            3 bytes hashing
bt4
bt5    64 KB ... 48 MB    11.5 * d            4/5 bytes hash-ing
    64 MB ... 1024 MB    10.5 * d            
hc4
hc5    64 KB ... 48 MB    7.5 * d        Hash Chain     
    64 MB ... 1024 MB    6.5 * d            
Note: Your operation system also needs some amount of physical memory for internal purpos-es. So keep at least 32MB of physical memory unused.


fb={N}
Sets number of fast bytes for LZMA. It can be in the range from 5 to 273. The default value is 32 for normal mode and 64 for maximum and ultra modes. Usually, a big number gives a little bit better compression ratio and slower compression process.
為LZMA設置快速字元的數量。其範圍可以在5到273之間。默認值為正常模式下的32和最大及超級模式下的64。通常,大數字會帶來稍微更好的壓縮率,但壓縮過程也會變慢。
-m0=LZMA fb=64


mc={N}
Sets number of cycles (passes) for match finder. It can be in range from 0 to 1000000000. De-fault value is (16 + number_of_fast_bytes / 2) for BT* match finders and (8 + num-ber_of_fast_bytes / 4) for HC4 match finder. If you specify mc=0, LZMA will use default val-ue. Usually, a big number gives a little bit better compression ratio and slower compression process. For example, mf=HC4 and mc=10000 can provide almost the same compression ratio as mf=BT4.
設置匹配查找器的循環次數(通過數)。範圍可以從 0 到 1000000000。對於 BT* 匹配查找器的預設值為 (16 + fast_bytes 數量 / 2),對於 HC4 匹配查找器的預設值為 (8 + fast_bytes 數量 / 4)。如果您指定 mc=0,則 LZMA 將使用預設值。通常,較大的數字會提供稍微更好的壓縮比,但壓縮過程會較慢。例如,mf=HC4 和 mc=10000 的壓縮比幾乎可以與
當你設置 mc=0 時,實際上是讓 LZMA 使用 bt4 作為匹配查找器,這是其 預設配置。
bt4 Dictionary字典大小 64 KB ... 48 MB 記憶體使用 11.5 * d  + 4 MB

                                

lc={N}
Sets the number of literal context bits (high bits of previous literal). It can be in range from 0 to 8. Default value is 3. Sometimes lc=4 gives gain for big files
設置字面上下文位元的數量(前一個字面的高位元)。範圍可以從 0 到 8。預設值為 3。有時 lc=4 對於大型檔案有所增益。
lc=8


lp={N}
Sets the number of literal pos bits (low bits of current position for literals). It can be in the range from 0 to 4. The default value is 0. The lp switch is intended for periodical data when the period is equal to 2^value (where lp=value). For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's better to set lc=0, if you change lp switch.
設定字面位置位元的數量(當前位置的低位元,用於字面量)。它的範圍可以從0到4。默認值為0。lp開關是針對週期性資料而設計的,當週期等於2^value(其中lp=value)。例如,對於32位(4字節)週期性資料,您可以使用lp=2。通常,如果您改變lp開關,最好將lc設為0。
1p=0


pb={N}
Sets the number of pos bits (low bits of current position). It can be in the range from 0 to 4. The default value is 2. The pb switch is intended for periodical data when the period is equal 2^value (where lp=value).

設置位置的位數(當前位置的低位)。其範圍可以從 0 到 4。默認值為 2。pb 開關是為了週期性數據,當週期等於 2^value 時(其中 lp=value)。
      Pb=4
      
在 7-Zip 中的應用:
•    當某些參數設置為「2^value」時,這些參數的值會是 2 的某個次方,這樣的設置常見於需要使用二進位(binary)數字的算法中,因為計算機系統的設計(特別是內存管理)更適合處理這樣的數值。

假設在 7-Zip 的壓縮設置中有一個參數 DictionarySize,並且這個參數的設置選項是基於 2 的冪次方 的,比如:
•    DictionarySize = 2^19 表示字典大小為 2^19 = 524288 字節,也就是 512KB。
•    DictionarySize = 2^21 表示字典大小為 2^21 = 2097152 字節,也就是 2MB。



LZMA2
LZMA2 is modified version of LZMA. it provides the following advantages over LZMA:
•    Better compression ratio for data than can't be compressed. LZMA2 can store such blocks of data in uncompressed form. Also it decompresses such data faster.
•    Better multithreading support. If you compress big file, LZMA2 can split that file to chunks and compress these chunks in multiple threads.
LZMA2 是 LZMA 的修改版本。它提供了以下對 LZMA 的優勢:對於無法壓縮的數據,具有更好的壓縮比。LZMA2 可以將這些數據塊以未壓縮的形式存儲,並且對這些數據的解壓速度更快。 更好的多線程支持。如果您壓縮大型文件,LZMA2 可以將該文件分割成幾個塊,並在多個線程中壓縮這些塊。
•  c:這是設置字典大小的參數。
•  {Size}:是字典的大小數值。
•  [b|k|m|g]:這是字典大小的單位,分別代表:




Parameter    Default          Description
c={Size}[b|k|m|g]
   dictSize * 4    Sets Chunk size


DictSize 每個壓縮的數據塊
        
如果你設置 dictSize 為 32MB,那麼:
每個壓縮塊的大小將會是:32MB * 4 = 128MB。
這意味著每個壓縮的數據塊大小會是 128MB

為什麼要設置這個參數:
•    壓縮效果:使用更大的字典和塊大小通常可以提高壓縮率,特別是對於大文件來說,這樣可以更好地利用數據的重複性來壓縮。
•    性能考量:較大的字典和塊大小可能會增加內存需求,並且在某些情況下會讓壓縮或解壓的速度變慢,尤其是在內存不足的情況下。

什麼是 Chunk Size?
•    Chunk:就是一個數據塊,每次壓縮算法處理的單位。LZMA2 壓縮算法會把大的文件分割成多個小塊進行壓縮。
•    Chunk Size:指每個壓縮塊的大小。這個大小決定了壓縮過程中每次壓縮的範圍,對應於如何將數據分割進行處理。

If you don't specify ChunkSize, default ChunkSize is caluclated by the formula:
ChunkSize = max(DictionarySize, min(256M, max(1M, DictionarySize * 4)))


假設 DictionarySize = 512KB:
1.    DictionarySize * 4:
512KB * 4 = 2048KB = 2MB
2.    max(1M, 2MB):
2MB 比 1MB 大,所以選擇 2MB。
3.    min(256M, 2MB):
2MB 小於 256MB,所以選擇 2MB。
4.    max(512KB, 2MB):
2MB 比 512KB 大,所以最終選擇 2MB。
因此,最終的 ChunkSize 是 2MB。




   
LZMA2 also supports all LZMA parameters, but lp+lc cannot be larger than 4.
LZMA2 uses: 1 thread for each chunk in x1 and x3 modes; and 2 threads for each chunk in x5, x7 and x9 modes. If LZMA2 is set to use only such number of threads required for one chunk, it doesn't split stream to chunks. So you can get different compression ratio for different num-ber of threads. You can get the best compression ratio, when you use 1 or 2 threads.

LZMA2也支持所有LZMA參數,但lp+lc的值不能大於4(lc=4 對於大型檔案有所增益
1p=0)。LZMA2在x1和x3模式下每個塊使用1個線程;在x5、x7和x9模式下每個塊使用2個線程。如果LZMA2設置為僅使用單個塊所需的線程數,它將不會將流拆分為塊。因此,您可以根據不同的線程數獲得不同的壓縮比。當您使用1或2個線程時,可以獲得最佳的壓縮比。
•  -m0=LZMA2:選擇 LZMA2 壓縮算法。
•  -c={Size}[b|k|m|g]:設置壓縮字典的大小。
•  dictSize * 4:表示 LZMA2 實際上會使用字典大小的四倍內存來進行壓縮。






PPMd
PPMd is a PPM-based algorithm. This algorithm is mostly based on Dmitry Shkarin's PPMdH source code. PPMd provides very good compression ratio for plain text files. There is no dif-ference between compression speed and decompression speed. Memory requirements for compression and decompression also are the same.

PPMd是一種基於PPM的算法。該算法主要基於Dmitry Shkarin的PPMdH源代碼。PPMd對於純文本文件提供了非常好的壓縮比。壓縮速度和解壓縮速度之間沒有差異。壓縮和解壓縮的內存需求也相同。


Parameter    De-fault    Description
mem={Size}[b|k|m|g]
24    Sets size of used memory for PPMd.
o={Size}
6    Sets model order for PPMd.

mem={Size}[b|k|m|g]:設置 PPMd 使用的內存大小。
o={Size}:設置 PPMd 的字典大小

Sets the size of memory used for PPMd. You must specify the size in bytes, kilobytes, or meg-abytes. The maximum value is 2GB = 2^31 bytes. The default value is 24 (16MB). If you do not specify any symbol from the set [b|k|m|g], the memory size will be calculated as (2^Size) bytes. PPMd uses the same amount of memory for compression and decompression.

設置 PPMd 使用的記憶體大小。您必須以字節、千字節或兆字節指定大小。最大值為 2GB = 2^31 字節。預設值為 24(16MB)。如果您未指定集 [b|k|m|g] 中的任何符號,則記憶體大小將計算為 (2^Size) 字節。PPMd 在壓縮和解壓縮時使用相同量的記憶體。
o={Size}
Sets the model order for PPMd. The size must be in the range [2,32]. The default value is 6.

o={大小} 設定PPMd的模型順序。大小必須在[2,32]範圍內。預設值為6。

XZ
XZ supports only LZMA2 codec now. The switches are similar to switches for 7z format.
XZ 目前只支持 LZMA2 編解碼器。這些開關與 7z 格式的開關類似。
XZ 是一種基於 LZMA2 算法的壓縮格式,它與 .tar.xz 等檔案格式經常搭配使用,廣泛應用於 Linux 等系統。
這裡將介紹如何在 7-Zip 中使用 XZ 壓縮格式以及一些有用的參數。


Parameter     De-fault     Description
x=[1 | 3 | 5 | 7 | 9 ]     5     Sets level of compression
f=FilterID         Sets compression filter. FilterID: Delta:{N}, BCJ, ARM64, ARM, ARMT, RISCV, IA64, PPC, SPARC
{N}={MethodID}[:param1][:param2][..]    LZMA2     Sets compression method: LZMA2:[param1]:[param2]:[...]
mt=[off | on | {N}]     on     Sets multithreading mode
s=[off | on | [{N}b | {N}k | {N}m | {N}g | {N}t]]
off     Sets solid mode.
s=[off | on | [{N}b | {N}k | {N}m | {N}g | {N}t]]
Enables or disables solid mode. The default mode is s=off. In solid mode, there is only one block per file or stream.
{N}b | {N}k | {N}m | {N}g    Set a limit for the total size of a solid block in bytes
If size of solid block is not specified, the default value of solid block size will be calculated, The default solid block size depends on the dictionary size. The default dictionary size de-pends on the compression level.
The default solid block size is caluclated by the formula:
    SolidBlockSize_xz = max(DictionarySize, min(256M, max(1M, DictionarySize * 4)))
啟用或禁用固體模式。默認模式為 s=off。在固體模式下,每個文件或流僅有一個區塊。{N}b | {N}k | {N}m | {N}g 設置固體區塊的總大小限制(字節)。如果未指定固體區塊的大小,將計算默認的固體區塊大小,默認的固體區塊大小取決於字典大小。默認字典大小取決於壓縮級別。默認固體區塊大小的計算公式為:SolidBlockSize_xz = max(DictionarySize, min(256M, max(1M, DictionarySize * 4)))






字典大小
dictionary_size
   
預設固實區塊大小
Default solid block size
   
smaller than 256 KB    1 MB
256 KB - 64 MB     dictionary_size * 4
64 MB - 256 MB     256 MB
larger than 256 MB     dictionary_size
block size must be equal or large than dictionary size.
If you use multiple blocks:
•    the compression ratio with small blocks usually is worse.
區塊大小必須等於或大於字典大小。如果您使用多個區塊: 通常小區塊的壓縮比會較差。
•    blocks are independent. So losses in case of data damage is limited only to damaged blocks.
•    it's possible to extract some particular block of data faster.
•    there is index record at the end of xz stream that contains information about position and size of each block.
•    • 區塊是獨立的。因此,數據損壞的損失僅限於受損的區塊。• 可以更快地提取某個特定的數據區塊。• 在 xz 流的末尾有索引記錄,包含有關每個區塊的位置和大小的信息。

Note: xz uses: 1 thread for each block in x1 and x3 modes; and 2 threads for each block in x5, x7 and x9 modes. If xz is set to use only such number of threads required for one block, it doesn't split stream to blocks. So you can get different compression ratio for different number of threads. You can get the best compression ratio, when you use 1 thread (for x1 and x3 modes) or 2 threads (for x5, x7 and x9 modes).
Note: each xz block contains LZMA2 stream of data. And LZMA2 also can be divided to in-dependent blocks (chunks). The difference between xz blocks and LZMA2 blocks, that each xz block contains also checksum (crc or sha), and there is index record at the end of xz stream that points to each xz block. 7-Zip by default uses xz blocks. But it's possible to specify the mode when it will use one xz block, and multiple LZMA2 blocks instead.

注意:xz 在 x1 和 x3 模式下,對於每個區塊使用 1 條執行緒;在 x5、x7 和 x9 模式下,對於每個區塊使用 2 條執行緒。如果 xz 被設置為僅使用每個區塊所需的執行緒數,它不會將流切割為區塊。因此,您可以根據執行緒數獲得不同的壓縮比。當您使用 1 條執行緒(對於 x1 和 x3 模式)或 2 條執行緒(對於 x5、x7 和 x9 模式)時,可以獲得最佳的壓縮比。注意:每個 xz 區塊包含 LZMA2 資料流。LZMA2 也可以被劃分為獨立的區塊(塊)。xz 區塊和 LZMA2 區塊之間的區別在於,每個 xz 區塊還包含校驗和(crc 或 sha),並且在 xz 流的末尾有一個索引記錄指向每個 xz 區塊。7-Zip 預設使用 xz 區塊。但可以指定模式,當它會使用一個 xz 區塊,而是多個 LZMA2 區塊。







Examples:
        s=16m
      
use 16 MB blocks.

        s
      
use one solid xz block per file.

        s c16m
      
use one solid xz block per file and 16 MiB LZMA2 blocks.


WIM
Parameter    De-fault    Description
im={ImageNumber}
    Sets image number.
is=[off | on]    off    Show image number in paths.
tm=[off | on]     on     Stores last Modified timestamps for files.
tc=[off | on]     off     Stores Creation timestamps for files.
ta=[off | on]     off     Stores last Access timestamps for files.
If image number is specified, 7-Zip works only with that image inside WIM archive. Other im-ages will be not changed. By default 7-Zip doesn't show image number, if there is only one image in WIM archive, or if image number is specified. But if the switch "is" specified, 7-Zip shows image number.
如果指定了映像號碼,7-Zip 只處理 WIM 包檔案內的該映像。其他映像將不會被修改。默認情況下,當 WIM 包檔案中只有一個映像,或是指定了映像號碼時,7-Zip 不會顯示映像號碼。但如果指定了開關"is",7-Zip 會顯示映像號碼。

7-Zip 也支援壓縮和解壓 .WIM(Windows Imaging Format)格式的檔案。WIM 檔案通常用於備份、安裝映像或系統恢復,它是 Microsoft 用來存儲 Windows 系統映像的格式。






Examples
7z a archive.zip *.jpg -mx0
adds *.jpg files to archive.zip archive without compression.
7z a archive.7z *.exe *.dll -m0=BCJ -m1=LZMA:d=21
adds *.exe and *.dll files to solid archive archive.7z using LZMA method with 2 MB diction-ary and BCJ filter.
7z a archive.7z a.tar -mf=BCJ2 -mx
adds a.tar files to archive archive.7z using BCJ2 filter.
7z a archive.7z *.wav -mf=Delta:4
adds *.wav files to archive archive.7z using Delta:4 filter.
7z a a.7z *.exe *.dll -m0=BCJ2 -m1=LZMA:d25 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3
adds *.exe and *.dll files to archive a.7z using BCJ2 filter, LZMA with 32 MB dictionary for main output stream (s0), and LZMA with 512 KB dictionary for s1 and s2 output streams of BCJ2.
7z a archive.7z *.txt -m0=PPMd
adds *.txt files to archive archive.7z using PPMd method.
7z a a.tar.xz a.tar -mf=bcj -mx
adds a.tar files to archive a.tar.xz using BCJ filter.
Commands that can be used with this switch
a (Add), h (Hash), d (Delete), rn (Rename), u (Update)
See also
Switches: -t (set Type of archive),









............................................................................................................





文章來源: https://mrtang.tw/blog/post/27861881

不是每個人的電腦都有安裝7-Zip,換句話說,也就是 不是每個人的電腦都能直接開啟.7z檔,如果收到壓縮檔的使用者電腦沒有安裝任何的壓縮/解壓縮軟體,那他將沒有辦法開啟你所寄給他的壓縮檔,那有沒有解決的辦法呢?

當然有,就是建立「自解壓縮檔」,所謂的「自解壓縮檔」意思就是,7-Zip除了將你要壓縮的資料打包壓縮之外,它還會將7-Zip的解壓縮程式也一起打包進去,所以收到這個壓縮檔的人就不需要再安裝任何的解壓縮軟體,就可以直接將資料解壓縮出來。

.zip檔 不能用      建立自解壓縮檔  只有.7z 才可以喔!


                               
登錄/註冊後可看大圖



                               
登錄/註冊後可看大圖



                               
登錄/註冊後可看大圖








.....................................................................................................................


7-Zip 加密方法
選 AES-256 比較安全


                               
登錄/註冊後可看大圖









「用Android 就來APK.TW」,快來加入粉絲吧!
Android 台灣中文網(APK.TW)
熱門小遊戲推薦
收藏收藏 分享分享 分享專題
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則