7zip equivalent to "zip -9" for maximum compression?

7,073

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.)

Share:
7,073

Related videos on Youtube

jww
Author by

jww

Updated on September 18, 2022

Comments

  • jww
    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
      Seth over 7 years
      According to that man page it would probably be something like 7z a cryptopp.7z -r -mx=9 cov-int/*
  • kayleeFrye_onDeck
    kayleeFrye_onDeck about 2 years
    Behavior changes based on file-type. For .zip use with 7z 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.