7zip equivalent to "zip -9" for maximum compression?
Use -mx=9
switch.
As you can see on the manual page you linked, 7z offers you several methods of compression: Copy, Deflate, Deflate64, BZip2, LZMA, PPMd
In paragraph related to each method, you can see whether x
parameter (setting of compression level) is supported for that method and what levels are valid. You can see that value 9
is generally valid with all methods which support setting of compression level and it represents maximum compression.
So the example is (derived from the manual page):
7z a archive.zip *.jpg -mx9
(It is a bit strange that they write -mx9
without =
in the example. If this does not work, just use -mx=9
.)
Related videos on Youtube
jww
Updated on September 18, 2022Comments
-
jww over 1 year
Please forgive my ignorance here. I've read the 7zip man page, and its not clear to me how to achieve the equivalent to
zip -9 ...
. I think the man page of interest is -m (Set compression Method) switch.What is the 7zip equivalent to
zip -9 ...
for maximum compression?
In the larger picture, here is how it is being used on Windows. On Unix, Linux and OS X we use the
zip
command:7z.exe a -r -tzip cryptopp.zip cov-int
-
Seth over 7 yearsAccording to that man page it would probably be something like
7z a cryptopp.7z -r -mx=9 cov-int/*
-
-
kayleeFrye_onDeck about 2 yearsBehavior changes based on file-type. For
.zip
use with7z a
the default output size seems the same as using-mx9
. However this is not true to.7z
files, and you need to specify-mx9
for max compression. Btw, both-mx9
and-mx=9
work fine.