7zip Ultra LZMA2 compression
Solution 1
Your command line should be at least:
7z a -t7z Files.7z -m0=lzma2 -mx=9 -aoa
Note that you'll get better compression when using 1 or 2 threads, not 8.
So, even closer to your GUI settings (ms
: solid, d
: dictionary size, mhe
: encrypt header (file names), p
: password)
7z a -t7z -m0=lzma2 -mx=9 -aoa -mfb=64 -md=32m -ms=on -d=1024m -mhe -pSECRET
Solution 2
It's hard to get the same result, but this is the best I can get so far:
7z a -t7z Files.7z -m0=BCJ2 -m1=LZMA2:d=1024m -aoa
Solution 3
For those who are on unix system, this is how I achieved this.
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=1024m -ms=on destination.7z Source
My source: http://manpages.ubuntu.com/manpages/artful/man1/7z.1.html
Solution 4
This command is creating for me the same output like the ultra configuration with the ui. I have found it in the documentation under examples. 560MB to 29MB (binary data with a lot duplicate files)
7za.exe a output.7z ./input -mx
Comments
-
fiberOptics almost 2 years
How can I convert this settings into command?
Here are the results:
// Manual Compression (see the image above) Compressed Size: 12,647,451 bytes // Ultra 7z a -t7z Files.7z -mx9 -aoa Compressed Size: 12,676,886 bytes // LZMA2 7z a -t7z Files.7z -m9=LZMA2 -aoa Compressed Size: 14,237,515 bytes
I am looking here:
http://sevenzip.sourceforge.jp/chm/cmdline/switches/method.htmI am about to put this in a batch file.
-
Aquarius Power over 9 yearsdid it provide better compression?
-
fiberOptics over 9 yearsthere would be only less than 1MB difference compared to using GUI.
-
Aquarius Power over 9 yearsbtw, on my test this simple
7z a -t7z -mx9
worked better, but in my case the file was too small and may not work the same for you... anywaykgb -9
won but is slow... (oh btw I am on linux..) -
Jeroen Wiert Pluimers over 7 yearsI'm not sure as of which 7z version it barfs on
-d=1024m
, but this works for version 16.04 on Windows:7z.exe a -t7z -m0=lzma2:d1024m -mx=9 -aoa -mfb=64 -md=32m -ms=on
. I also append ` -sdel` to the options for moving files to an archive. -
milivojeviCH over 7 yearsUsing 1, 2 or 3 threads uses the same amount of memory for compression which makes me think that they all share the same dictionary. Based on my tests, there's no drop in compression efficiency for up to 3 threads.
-
Able Mac almost 5 years-aoa is an extraction option. It means don't overwrite files that already exist on disk. It is ignored when compressing files to an archive.
-
Nilesh over 4 yearsWhat is the significance of
-t7z
? -
tricasse over 4 years@Nilesh:
-t7z
= archive type 7z