Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
7-Zip
Welcometo7-Zip4.57!
7-Zipisafilearchiverwithahighcompressionratio.
Thedocumentationfor7-Zipincludes:
Generalinformationabout7-Zip
User'sGuidefor7-ZipFileManager
User'sGuideforcommandlineversion
SeeAlso
Howtoregisterto7-Zip
FrequentlyAskedQuestions(FAQ)
Copyright(c)1999-2007IgorPavlov
Website:www.7-zip.org
Support:www.7-zip.org/support.html
Subscribetonews:http://www.7-zip.org/subscribe.html
Forum,bugstracking:http://sourceforge.net/projects/sevenzip/
GeneralInformation
Themainfeaturesof7-Zip
Powerfulfilemanager
Highcompressionratioandhighspeed
Bignumberofsupportedarchiveformats
Additionalcommandlineversion
SeeAlso
Howtoregister7-Zip
Licenseforuseanddistribution
Supportedformats
Format Compressing Decompressing FilenameExtensions7z X X 7zZIP X X zipGZIP X X gzgziptgzBZIP2 X X bz2bzip2tbz2tbzTAR X X tarRAR X rarCAB X cabARJ X arjZ X ztaz
CPIO X cpioRPM X rpmDEB X debLZH X lzhlhaSPLIT X 001002...CHM X chmchwhxsISO X iso
COMPOUND X msidocxlspptWIM X wimswmNSIS X exe
ZIP7-ZipcreatesfullyZIPcompatiblearchives.AnyonecandecompressthesefilesbyanyZIPcompatibledecompressionutility.Duringcompression7-ZipcanuseoneofthefollowingZIPcompressionmethods:
0-Store
8-Deflate
9-Deflate64
12-BZip2
Thecurrentversionofthe7-ZipcanextractanyfilesfromZIParchivethatwerecompressedwithoneofthefollowingmethods:
0-Store
1-Shrink
6-Implode
8-Deflate
9-Deflate64
12-BZip2
FilescompressedwithotherZIPcompressionmethodscan'tbeextractedbythecurrentversionofthe7-Zip.Butthesesupportedmethodsarethemostpopulartoday,andtherefore7-ZipcandecompressmostZIParchives.Toextractfilescompressedwithnon-supportedmethodsyoumustusesomeotherZIPutility.
7-ZipsupportstheZip64extensionofZIPformat.
Thecurrentversionof7-Zipdoesn'tsupportZipmultivolumearchives.
LZH7-ZipsupportsLZHarchivesonlyforlisting,browsinganddecompressing.7-Zipsupports-lh0-,-lh4-,-lh5-,-lh6-and-lh7-methods.
7zFormat
7zisanewarchiveformat,providingahighcompressionratio.
Themainfeaturesofthe7zformat:
Openarchitecture
Highcompressionratio
StrongAES-256encryption
Abilitytouseanycompression,conversionorencryptionmethod
Supportsfileswithsizesupto16000000000GB
Unicodefilenames
Solidcompression
Archiveheaderscompression
7zhasanopenarchitecture,soitcansupportanynewcompressionmethods.
Thefollowingmethodscurrentlyareintegratedinto7z:
Method DescriptionLZMA ImprovedandoptimizedversionofLZ77algorithmPPMD DmitryShkarin'sPPMdHwithsmallchangesBCJ Converterfor32-bitx86executablesBCJ2 Converterfor32-bitx86executablesBZip2 StandardBWTalgorithmDeflate StandardLZ77-basedalgorithm
LZMAisthedefaultandgeneralcompressionmethodof7zformat.ThemainfeaturesoftheLZMAmethod:
Highcompressionratio
Variabledictionarysize(upto4GB)
Compressionspeed:about1MB/son2GHzCPU
Decompressionspeed:about10-20MB/son2GHzCPU
Smallmemoryrequirementfordecompression(dependsfromdictionarysize)
Smallcodesizefordecompression:about5KB
Supportsmulti-threadingandP4'shyper-threading
TheLZMAcompressionalgorithmisverysuitableforembeddedapplications.IfyouwanttouseLZMAcode,youcanaskforconsultation,customcodeprogramming,andrequireddeveloperlicensesat
www.7-zip.org/support.html
7-ZipalsosupportsencryptionwiththeAES-256algorithm.Thisalgorithmusesacipherkeywithlengthof256bits.Tocreatethekey,7-ZipusesaderivationfunctionbasedonanSHA-256hashalgorithm.Akeyderivationfunctionproducesaderivedkeyfromatextpassworddefinedbytheuser.Toincreasethecostofanexhaustivesearchforpasswords,7-Zipusesabignumberofiterationstoproducethecipherkeyfromthetextpassword.
TipsforselectingpasswordlengthHereisanestimateofthetimerequiredforanexhaustivepasswordsearchattack,whenthepasswordisarandomsequenceoflowercaseLatinletters.
Wesupposethatoneusercancheck10passwordspersecondandanorganizationwithabudgetofabout$1billioncancheck10billionpasswordspersecond.Wealsosupposethattheprocessorinusedoublesitsperformanceeverytwoyears;so,eachadditionalLatinletterofalongpasswordaddsabout9yearstoanexhaustivekeysearchattack.
Theresultisthisestimateofthetimetosucceedinanattack:
PasswordLength SingleUserAttack OrganizationAttack1 2s 1s2 1min 1s3 30min 1s4 12hours 1s5 14days 1s6 1year 1s7 10years 1s8 19years 20s9 26years 9min10 37years 4hours11 46years 4days12 55years 4months13 64years 4years14 73years 13years15 82years 22years16 91years 31years17 100years 40years
Performance
ZIPFormat
Compressionratioresultsareverydependentuponthedatausedforthetests.Wecompared7-Zipwithsomeoftheleadingcommercialarchivers:PKZIP2.04g,WinZip7.0.
FILESET:TheCanterburyCorpus(11filestotaling2,810,784bytes,popularfilesetusedtocompressionrates).
Archiver Compressedsize Ratio7-Zip(zipformat) 676284 100%PKZIP2.04g-ex 726047 107%WinZip7.0(Max) 731499 108%
7zFormat
7zisthenewarchiveformat,providingahighcompressionratio.
FILESET:TheGIMP1.2.4forWindowsafterfullinstallation(127subfolders,1304filestotaling27,128,826bytes).TheGIMPistheGNUImageManipulationProgram.Itcanbedownloadedfromwww.gimp.org.
Archiver Compressedsize Ratio7-Zip(7zformat) 5445402 100%WinRAR3.10 6004155 110%WinAce2.3 6242424 115%CABARC1.0 6455327 119%7-Zip(zipformat) 9461621 174%PKZIP2.50 9842800 181%
GZIPFormat
7-ZipprovidesthebestcompressionratioforGZIPformat.ThecompressionratioisequaltoitscompressionratioforZIPformat(above).
RARFormat
7-ZipprovidessuperiordecompressionspeedforRARarchives.Forsolidarchivesitdecompressesonlytheminimumnumberoffilesneeded.Forexample,considerasolidarchivearchive.rarcontaining100000filescreatedbythecommand:raraarchive.rar-s100*-rInthissolidarchive,eachgroupof100filesiscompressedasonebigfile.Toextractonefilefromthatarchive,7-Zipwilldecompress(inmemory)onlysomefilesfromonegroup.Asaresult,7-Zipcanprovidethecombinedadvantagesofsolidcompressionandhighspeedofdecompression.
FrequentlyAskedQuestions(FAQ)
CanIuse7-Zipinacommercialorganization?
Yes,7-Zipisfreesoftware.Youcanuseitonanycomputer.Youdon'tneedtoregisterorpayfor7-Zip.
Whydoesn'tthecommandlineversionaddfilesthatdonothaveanyextension?
Youprobablyuseda*.*wildcard.7-Zipdoesn'tusetheWindowssystemwildcardparser;so,7-Zipdoesn'tfollowthearchaicrulebywhich*.*matcheseveryfilename.7-Ziptreats*.*asmatchingonlyafilenamewithanextension.Toprocessallfiles,youmustusea*wildcardorjustomitthewildcardentirely.
Whydoesn'tadding,deletingorupdatinganexistingarchivework?
Thecurrentversionof7-Zipcannotchangeanarchivecreatedwiththesolidoptionswitchedon.Toupdatea.7zarchiveyoumustcreateandupdatethearchiveinnon-solidmode(-ms=offswitch)
WhataboutsupportforACEarchives?
SupportforACEcanbeimplemented,ifthesourcecodeofthatformatismadeavailable,andifthesourcecodelicensewillallowusingthatcode.
License
7-ZipCopyright(C)1999-2007IgorPavlov.
Licensesforfilesare:
7z.dll:GNULGPL+unRARrestriction
Allotherfiles:GNULGPL
TheGNULGPL+unRARrestrictionmeansthatyoumustfollowbothGNULGPLrulesandunRARrestrictionrules.
Note:Youcanuse7-Ziponanycomputer,includingacomputerinacommercialorganization.Youdon'tneedtoregisterorpayfor7-Zip.
ReadfileLicense.txtforfullinformationaboutlicense.
Register7-Zip
7-Zipisfreesoftware.However,youcansupportdevelopmentof7-Zipbyregistering.
Youcanfindallinformationaboutregisteringat:
http://www.7-zip.org/register.html
Thankyouverymuchinadvance!
Thanks
Iwouldliketothank:
ARJSoftware-forARJformat.
WeiDai-forSHA-256codeandCrypto++Library
JeffGilchrist-forcompressingtests
BrianGladman-forAEScodeinpreviousversionsof7-Zip
SzymonGrabowski-forsomeideas
MicrosoftCorporation-forCABformatdescription,andWiX(WindowsInstallerXML)
myspace-forportingtoUnix/Linux,testing,bugfixingandmore
Nullsoft,Inc.andNSISteam-forNSIS(NullsoftScriptableInstallSystem)
RobertMartinez-7-ZipLogo
MarkusOberhumerandLaszloMolnar-forUPXprogram
AlexanderRatushnyak-forcompressingtests
EugeneRoshal-forRARformat
MatthewRussotto-forCHM/CABformatdescription
JulianSeward-forBZip2format
EugeneShelwien-forsomeideasandalgorithms
DmitryShkarin-forPPMdalgorithm
YoshiokaTsuneo-forTAR32program
VadimYoockin-forcompressingtests
BulatZiganshin-forsomeideas
JohnMichaelWilliams-forhelpfilecorrections
Localizationteam:
Afrikaans-PetriJooste
Albanian-MIkelHasko
Arabic-MohammadDeeb,AwadhAAl-Ghaamdi
Armenian-GevorgPapikyan
Asturian-Dinamiteru
Azeri-F@rhad
Basque-InigoSalvadorAzurmendi
Belarusian-KirillGulyakevitch,DriveDRKA
Breton-KAD-KorvigellouAnDrouizig
Bulgarian-Chavv,icobgr
Catalan-JosepCasals,GaizkaBoleko,MarcFolch
ChineseSimplified-ModernTiger,kaZek,HutuLi,Junior.Spirit
ChineseTraditional-LeonTseng,sec2
Croatian-AlanSimek,HasanOsmanagic
Czech-JaromirVeber,MilanHruby,MichalMolhanec
Danish-JakobSchmidt,KianAndersen
Dutch-BertvanVelsen,JeroenvanderWeijde,HarmHilvers,JeroenTulp
Esperanto-DmitriGabinski
Estonian-KaupoSuviste
Extremaduran-MiguelAngel
Farsi-EdrisNaderan,MehdiFarhadi
Finnish-AriRyynanen,JarkoP.,JuhaniValtasalmi
French-NicolasSierro,PhilippeBerthault
Friulian-AndreaDecorte
Frisian-BerendYtsma
Galician-XoseCalvo
Georgian-DimitriGogelia
German-SoerenFinster,JAK-Software,JoachimHenke
Greek-VasileiosKarakoidas,JacarandaBill
Hebrew-GalBrill,JonathanLahav
Hungarian-JozsefTamasHerczeg
Ido-iZoom
Indonesian-M.RofiqSetiawan
Italian-LeandroSpagnol,TJL73
Japanese-Komuro,Mick,2chBBS-software,StepanushkinDmitry
Korean-bzImage,ZannyLim,HyeongilKim(kurtSawyer)
Kurdish-RizyoyeXerzi
Latvian-ArmandsRadzushka
Lithuanian-MariusNavickas
Macedonian-GabrielStojanoski
Malay-KhairulRidhwanOmar
Marathi-SubodhGaikwad
Mongolian-Bayar
NorwegianBokmal-ChristofferAndersen,KjetilHjartnes,RobertGronning
NorwegianNynorsk-RobertGronning
Polish-Cienislaw,Pixel,F1xat
PortugueseBrazil-FranciscoJr,FabricioBiazzotto,AtualizadoporFelipe
PortugueseStandard-CarlosMacao,JoaoAlves,RuiCosta
Romanian-LucianNan
Serbo-Croatian-MiodragJevremovicc
Slovak-TomasTomasek,PavelDevecka
Slovenian-JernejSimoncic,miles
Spanish-PabloRodriguez,Jbc25,GuillermoGabrielli
Swedish-AndreasNilssonandChristofferEnqvist
Tamil-VeElanjelian
Tatarish-AlbertFazli
Thai-ChayanonRuamcharoen
Turkish-
Ukrainian-AndrijIlechko,MokiyMazaylo,SergiyGontaruk
Uzbek-SherzodMamatkulov
Valencian-TomasMiralles,FernandoVerdu
Vietnamese-TranHongHa,LeVuHoang
Voro-ValdisLaan
Welsh-OwainLewis
7-ZipFileManager
The7-ZipFileManagerisaprogramformanipulatingfilesandfolders.
The7-ZipFileManagercanworkwithtwopanels.YoucanswitchbetweenpanelsbypressingtheTabbutton.Mostoftheoperationscanbeexecutedusingkeyboardshortcutsorbyright-clickingonitemsandselectingtheappropriatecommandfrommenu.
InThisSection
MenuItemsandShortcutKeysDescribesthemenuitemsandkeyboardshortcut.
OptionsDialogBoxDescribeswhatsettingsyoucanchangethataffectthe7-ZipFileManager.
BenchmarkDescribesa7-ZipBenchmarkformeasuringCPUperformance.
AboutDialogBoxProvidesinformationabout7-Zip.
PluginsDescribespluginsforthe7-ZipFileManager.
OptionsDialogBox
Youcanchangemanyofthesettingsthataffectthe7-ZipFileManagerintheOptionsdialogbox.ToaccessthisdialogboxselectOptionsfromtheToolsmenu.
Theoptionsdialogboxcontainsthefollowingpages:
SystemPage
PluginsPage
EditorPage
SettingsPage
LanguagePage
SystemPageAllowsyoutospecifythebehaviorof7-Zipinthefilingsystem.
Associate7-ZipwithListsthefilenameextensionsandassociatedpluginsthatarecurrentlyregisteredwith7-Zip.Iffilenameextensionischecked,7-Zipwillbeusedtoopenfilewiththatextension.Inanycaseyoucanalwaysopenallarchiveswith7-Zipviayourright-clickcontextmenu.
PluginsPageAllowsyoutospecifysettingsfortheinstalledplugins.
PluginsListstheplugins.Formodifyingsettingsofplugins,youmustselectthepluginandpresstheOptionsbutton.
EditorPageAllowsyoutospecifysettingsfortheeditor.
EditorSpecifiesthepathtotheeditor.
SettingsPageAllowsyoutospecifysomesettings.
Show..itemShows..iteminfilelist.
ShowrealfileiconsShowsrealfileiconsinfilelist.Ifthisoptionisenabled,listingupdatescanbeslower.
ShowsystemmenuShowsasystemcontextsub-menuintheFilemenu.
FullrowselectWhenanitemisselected,theitemandallitssubitemsarehighlighted.
ShowgridlinesDisplaysgridlinesarounditemsandsubitems.
AlternativeselectionmodeIfenabled,FileManagerkeepsselectionmarkwhenyoumovecursor.
UselargememorypagesIfenabled,7-Zipwilltrytouselargepages.Thisfeatureallowsanincreaseinspeedofcompression.Thismaycause7-Ziptopausewhenstartingcompression,becauseofallocationofthelargepages.Also,theWindowsTaskManagerdoesn'tshowtherealmemoryusageoftheprogram,if7-Zipuseslargepages.ThisfeatureworksonlyonWindows2003/XPx64/Vista.Alsoyoumusthaveadministrator'srightsforyoursystem.RecommendedsizeofRAM:1GBormore.Toinstallthisfeatureyoumustrun7-ZipFileManageratleastonce,closeitandrebootthesystem.
LanguagePageAllowsyoutochangethedefaultlanguage.
LanguageListstheavailablelanguages.
Benchmark
Thisformallowsyoutomeasuretheperformanceofyourcomputer.
Therearetwotests:
1. CompressionwithLZMAmethod
2. DecompressionwithLZMAmethod
ThebenchmarkshowsaratinginMIPS(millioninstructionspersecond).Theratingvalueiscalculatedfromthemeasuredspeed,anditisnormalizedtoanIntelCore2DuoE6600(2.4GHz,4MBL2)CPUin64-bitWindowswithmulti-threadingoptionswitchedoff.SoifyouhaveIntelCore2Duo,ratingvaluesmustbeclosetorealCPUfrequency.
Youcanchangethedictionarysizetoincreasememoryusage.Alsoyoucanchangethenumberofthreads.
TheCPUUsagecolumnshowsthepercentageoftimetheprocessorisworking.It'snormalizedforaone-threadload.Forexample,180%CPUUsagefor2threadscanmeanthataverageCPUusageisabout90%foreachthread.
TheRating/Usagecolumnshowsratingnormalizedfor100%ofCPUusage.ThatcolumnshowsperformanceoftheoneCPUthread.
TheTotalratingshowsaveragesofthecompressinganddecompressionratings.
Compressionspeedandratingstronglydependfrommemory(RAM)latency.
DecompressionspeedandratingstronglydependonCPUintegeroperations.Forexample,anIntelPentium4hasbigbranchmispredictionpenalty(whichiseffectoflongpipeline)andprettyslowmultiplyandshiftoperations.So,thePentium4hasprettylowdecompressingratings.
Alsotheprogramcheckspossibleerrors.Iftheprogramshowssomeerrormessage,inmostcasesitmeansthatyourRAMisdefective.Ifso,don'tuse7-Zipforcompressingdata,sincesucherrorscanleadtodatalosses.
AboutDialogBox
TheAboutdialogboxprovidesinformationabout7-Zipandallowsyoutoregister7-Zip.ThisdialogboxisavailablefromtheHelpmenu.
Presswww.7-zip.orgbuttonforopening7-ZipHomePage.
PressRegisterbuttontoregister7-Zip.
SeealsoRegister7-Zipformoredetailshowtoregister7-Zip.
Plugins
The7-ZipFileManagercanuseinternalandexternalplugins.
Currently7-Zipusesthefollowingplugins:
7-ZipPluginformanipulatingarchives.
7-ZipPlugin
7-Zipisapluginformanipulatingarchives.ItmakesallarchivefileslooklikeusualfoldersinFileManager.
Mostoftheoperationswithcompressedfilescanbeinitiatedbyright-clickingonfilesintheFileManager(orinWindowsExplorer)andselectingtheappropriatecommandfromamenu.
Using7-Zip
Openingarchive
Therearetwowaystoopenanarchivefile:
Ifyouhavethefiletypeassociatedwith7-Zip,thenyoucanopenthefilewith7-Zipbydouble-clickingthefileorbyright-clickingandselectingtheOpencommand.
Youcanright-clickthearchivefile,pointto7-Zip,andthenclicktheOpencommanditem.
Extractingarchive
Therearetwowaystoextractfilesfromanarchive:
Toextractallfilesfromanarchiveright-clickthearchivefile,pointto7-Zip,andthenclicktheExtractfiles...commanditem.
Toextractspecificfilesfromanarchive,openitbyOpenarchivewith7-Zip,selecttheitemstoextract,andruntheCopyTo...command.
ExtractDialogwillappear.
Testingarchive
Totestanarchive,right-clickthearchivefile,pointto7-Zip,andthenclicktheTestarchivecommanditem.
Creatingandupdatingfilesinanarchive
Forcreatingorupdatinganarchivefile,right-clickthefile(s)orfolder(s)youwanttocompress,pointto7-Zip,andthenclicktheAddtoarchive...commanditem.AddtoArchiveDialogwillappear.
AddtoArchiveDialogBox
Allowsyoutospecifyoptionsforcreatingorupdatinganarchive.
Howtocallthisdialogbox
1. InWindowsExplorerorin7-Zip,right-clickthefile(s)orfolder(s)youwanttocompress.
2. Pointto7-Zip,andthenclicktheAddtoarchive...commanditem.
Parameters
ArchiveProvidesaspaceforyoutospecifyadestinationarchivename.Youcanclick"..."buttontodisplay"Open"dialogboxthatyoucanusetolocatearchive.
ArchiveformatSpecifiesaformatofcreatedarchive.Someformats(gzipandbzip2)donotsupportcompressingmoretheonefileperarchive.
Compressionlevel
Specifiescompressionlevel.Thereare6levelsofcompression:
Value MeaningStore Fileswillbecopiedtoarchivewithoutcompression.Fastest Fastestcompression.Fast Fastcompression.Normal Compressionwithbalancedsettings.
Maximum CangiveahighercompressionratiothanNormallevel.Butitcanbeslower,anditcanrequiremorememory.
Ultra CangiveahighercompressionratiothanMaximumlevel.Butitcanbeslower,anditcanrequiremorememory.
Compressionmethod
Specifiescompressionmethod.Eacharchiveformatcanhaveitsowncompressionmethods:
Method Description
LZMA Defaultcompressionmethodof7zformat.Itprovideshighcompressionratioandveryfastdecompression.
PPMdDmitryShkarin'sPPMdHalgorithmwithsmallchanges.Usuallyitprovideshighcompressionratioandhighspeedfortextfiles.
BZip2StandardcompressionmethodbasedonBWTalgorithm.Usuallyitprovideshighspeedandprettygoodcompressionratiofortextfiles.
Deflate
StandardcompressionmethodofZIPandGZipformats.Compressionratioisnottoohigh.Butitprovidesprettyfastcompressinganddecompressing.Deflatemethodsupportsonly32KBdictionary.
Deflate64 ModifiedversionofDeflatealgorithmwithbiggerdictionary(64KB).
Estimated7-ZipperformanceandmemoryrequirementsforAMDAthlon64X23800+:
Method Level DictionarySize
CompressingSpeed
DecompressingSpeed
MemoryforCompressing
LZMA
fastest 64KB 4.5MB/s
15MB/s
3MBfast 1MB 3MB/s 10MBnormal 16MB 2MB/s 186MBmaximum 32MB 1.8MB/s 376MBultra 64MB 1.6MB/s 709MB
PPMD
fast 4MB 1.4MB/s 6MBnormal 24MB 1.2MB/s 26MBmaximum 64MB 1.0MB/s 66MBultra 192MB 0.9MB/s 194MB
Deflate
fast
32KB
15MB/s
40MB/s3MB
normal 3.5MB/smaximum 1.5MB/s
4MBultra 0.4MB/s
BZip2normal
900KB3MB/s
16MB/s 20MBmaximum 1.2MB/sultra 0.4MB/s
Dictionarysize
SpecifiesDictionarysizeforcompressionmethod.
Usually,ahigherDictionarysizegivesahighercompressionratio.Butcompressingcanbesloweranditcanrequiremorememory.
Memory(RAM)usageforLZMAcompressingisabout11timesmorethandictionarysize.MemoryusageforLZMAdecompressingisclosetovalueofdictionarysize.MemoryusageforPPMdcompressinganddecompressingisalmostequaltodictionarysize.
Wordsize
Specifiesthelengthofwords,whichwillbeusedtofindidenticalsequencesofbytesforcompression.
UsuallyforLZMAandDeflate,bigWordsizegivesalittlebitbettercompressionratioandslowercompressionprocess.AbigWordsizeparametercansignificantlyincreasecompressionratioforfileswhichcontainlongidenticalsequencesofbytes.ForPPMd,theWordsizestronglyaffectsbothcompressionratioandcompression/decompressionspeed.
SolidBlocksize
Specifiesthesizeofasolidblock.Youcanalsodisablesolidmode.Insolidmodeallfileswillbecompressedascontinuousdatablocks.Usuallycompressingtoasolidarchiveimprovesthecompressionratio.Youcanusethisoptiononlyfor7zarchives.Withthecurrentversionof7z,youcanupdateexistingarchivesonlywhensolidmodeisswitchedoffandtheexistingarchiveisnon-solid.
NumberofCPUthreads
Specifiesthenumberofthreadsforcompressing.AbignumberofthreadscanspeedupcompressionspeedonMulti-Processorsystems.Sometimesitcanincreasespeedevenonsingle-coreCPU.
Splittovolumes{Size}[b|k|m|g]
SpecifiesvolumesizesinBytes,Kilobytes(1Kilobyte=1024bytes),Megabytes(1Megabyte=1024Kilobytes)orGigabytes(1Gigabyte=1024Megabytes).Ifyouspecifyonly{Size},7-zipwilltreatitasbytes.It'spossibletospecifyseveralvalues.Example:
10k15k2m
Thefirstvolumewillbe10KB,thesecondwillbe15KB,andallotherswillbe2MB.
Parameters
Allowsyoutospecifyparametersforcompression.Seethe-m(Method)switchdescriptionformoredetails.Omitthe-mprefix(asin-mswitch)whenusingthisdialogbox.
Examples0=PPMd
usesPPMdmethodforcompressingfiles.
0=bcj21=lzma:d232=lzma3=lzmab0:1b0s1:2b0s2:3
usesBCJ2filter(forx86executables)andLZMA.
Updatemode
Specifiesupdatemode:
Value MeaningAddandreplacefiles Addallspecifiedfilestothearchive.
Updateandaddfiles
Updateolderfilesinthearchiveandaddfilesthatarenewtothearchive.
Freshenexistingfiles
Updatespecifiedfilesinthearchivethatareolderthantheselecteddiskfiles.Replacespecifiedfilesonlyifaddedfilesare
Synchronizefiles newer.Alwaysaddthosefiles,whicharenotpresentinthearchive.Deletefromarchivethosefiles,whicharenotpresentonthedisk.
Options
Specifiescompressionoptions:
Option Meaning
CreateSFXarchive
Createself-extractingarchive.Youcanusethisoptiononlyfor7zarchives.Lookto-sfx(CreateSFXarchive)switchdescriptionformoredetailsaboutSFXmodules.
Compresssharedfiles
Compressfilesopenforwritingbyanotherapplications.
Encryption
Specifiespasswordandencryptionoptions.
EnterpasswordSpecifypassordhere
ReenterpasswordReenterpassordhereforverification
ShowPasswordShowsPassword
EncryptionmethodSpecifiestheencryptionmethod.For7zformat,itcanbeonlyAES-256.ForZIPformatyoucanselectZipCryptoorAES-256.UseZipCrypto,ifyouwanttogetarchivecompatiblewithmostoftheZIParchivers.AES-256providesstrongerencryption,butnowAES-256issupportedonlyby7-Zip,WinZipandsomeotherZIParchivers.
EncryptfilenamesEnablesordisablesarchiveheaderencryption,includingfilenameencryption.
ExtractDialogBox
Allowsyoutospecifyoptionsforextractingfilesfromarchive.
Howtorunthisdialogbox
Therearetwowaystorunthisdialog
Toextractallfilesfromanarchive:
a. InWindowsExplorerorin7-Zip,right-clickthearchivefile.
b. Pointto7-Zip,andthenclickExtractfiles....
Toextractspecifiedfilesfromanarchiveopenedinthebrowsingwindow:
a. Openarchivewith7-Zip.
b. Selectitemstoextract.
c. Right-clickitemsandthenclickCopyTo....
Parameters
ExtracttoProvidesaspaceforyoutospecifyanoutputfolder.Youcanclick"..."buttontodisplay"Browseforfolder"dialogboxthatyoucanusetolocateoutputfolder.
Pathmode
Specifyextractmode:
Value MeaningFullpathnames Extractfileswithfullpathnames.Currentpathnames Extractfileswithallrelativepaths.Nopathnmes Extractfileswithoutfolderpaths.
Overwritemode
Specifyoverwritemodeforfilesthatalreadypresentondisk:
Value MeaningAskbeforeoverwrite
Askbeforeoverwritingexistingfiles.
Overwritewithoutprompt
Overwriteexistingfileswithoutprompt.
Skipexistingfiles
Skipextractingofexistingfiles.
Autorename
Renameextractedfiles,ifafilewiththesamenamealreadyexists.Forexample,filedocument.txtwillberenamedtodocument_1.txt.
Files
Specifiesfilesforextracting:
Value MeaningSelectedfiles Extractonlyfilesthatareselectedinthemainwindow.Allfiles Extractallfiles.
Password
Specifiesapasswordforencryptedarchives.
7-ZipOptionsDialogBox
Youcanchangemanyofthesettingsthataffectthe7-ZipPlugininthe7-ZipOptionsDialogBox.Toaccessthisdialogbox,selectOptionsfromtheToolsmenu,thenselectthePluginsPage,select7-Zipplugin,andpressOptions.
Theoptionsdialogboxcontainsthefollowingpages:
SystemPage
FoldersPage
SystemPageAllowsyoutospecifybehaviorof7-ZipinWindowsShell.
Integrate7-ZiptoshellcontextmenuSelectthischeckboxtoadd7-ZipcommandstoShellContextMenu.
CascadedcontextmenuSelectthischeckboxtogroup7-Zipcontextmenuitemstoone7-Zipsubmenu.
ContextmenuitemsListstheoptionalcontextmenuitems.Ifanitemischecked,7-Zipwilladdthisitemtothecontextmenu.
FoldersPageAllowsyoutosetthefolderswhich7-Zipwilluseforinternalpurposes.
WorkingfolderTheworkingfoldersectionallowsyoutospecifyafolderwhichwillbeusedfortemporaryarchivefiles:
Systemtempfolder7-ZipwillusetheWindowstempfolder.
Current7-Zipwillusethefoldercontainingthetargetarchive.
Specified7-Zipwillusethefolderspecifiedinthefollowingeditcontrol.
UseforremovabledrivesonlySpecifieswhether7-Zipshouldusethespecifiedfoldersettingsonlyforremovabledrives;forotherdrives,7-Zipwillcreatetemporaryarchivesinthefoldercontainingthetargetarchive.Ifyouclearthischeckbox,7-Zipalwayswillusethespecifiedfoldersettingsmodealways.
7-Zipusestemporaryarchivefilesforallupdateoperations.So,forspeedreasons,itisrecommendedthatyouselecttheSystemtempfolderoptionandselectUseforremovabledrivesonlycheckbox.
CommandLineVersionUser'sGuide
7z.exeisthecommandlineversionof7-Zip.7z.exeuses7z.dllfromthe7-Zippackage.7z.dllisusedbythe7-ZipFileManageralso.
7za.exe(a=alone)isastandaloneversionof7-Zip.7za.exesupportsonly7z,cab,zip,gzip,bzip2,Zandtarformats.7za.exedoesn'tuseexternalmodules.
CommandLinesyntax
ExitCodes
Commands
Switches
CommandLineSyntax7z<command>[<switch>...]<base_archive_name>[<arguments>...]
<arguments>::=<switch>|<wildcard>|<filename>|<list_file>
<switch>::=<switch_symbol><switch_characters>[<option>]
<switch_symbol>::='/'|'-'
<list_file>::=@{filename}
Expressionsinsquarebrackets(between'['and']')areoptional.
Expressionsincurlybraces('{'and'}')meanthatinsteadofthatExpression(includingbraces),theusermustsubstitutesomestring.
Expression
expression1|expression2|...|expressionN
meansthatany(butonlyone)fromtheseexpressionsmustbespecified.
Commandsandswitchescanbeenteredinupperorlowercase.
Commandisthefirstnon-switchargument.
The"base_archive_name"mustbethefirstfilenameonthecommandlineafterthecommand.
Theswitchesandotherfilenamescanbeinanyorder.
Wildcardsorfilenameswithspacesmustbequoted:
"Dir\Programfiles\*"
Dir\"Programfiles"\*
Switchoptionscanbecombinedtosavecommandlinelength.However,someswitchoptionstakeoptionalstringargumentsandtherefore,mustbethelastoptioninacombinedargumenttokenstringbecause7-Zipacceptstherestoftheargumenttokenastheoptionalargument.
7-ZipuseswildnamematchingsimilartoWindows95:
'*'meansasequenceofarbitrarycharacters.
'?'meansanycharacter.
7-Zipdoesn'tusesthesystemwildcardparser.7-Zipdoesn'tfollowthe
archaicrulebywhich*.*meansanyfile.7-Ziptreats*.*asmatchingthenameofanyfilethathasanextension.Toprocessallfiles,youmustusea*wildcard.
Examples:
*.txt meansallfileswithanextensionof".txt"?a* meansallfileswithasecondcharacterof"a"*1* meansallnamesthatcontainscharacter"1"*.*.* meansallnamesthatcontaintwo"."meanscharacters
Thedefaultwildcard"*"willbeusedifthereisnofilename/wildcardinthecommandline.
Slash('\')attheendofapathmeansadirectory.WithoutaSlash('\')attheendofthepath,thepathcanrefereithertoafileoradirectory.
Listfile
Youcansupplyoneormorefilenamesorwildcardsforspeciallistfiles(filescontaininglistsoffiles).Thefilenamesinsuchlistfilemustbeseparatedbynewlinesymbol(s).
Forlistfiles,7-ZipusesUTF-8encodingbydefault.Youcanchangeencodingusing-scsswitch.
Multiplelistfilesaresupported.
Forexample,ifthefile"listfile.txt"containsthefollowing:
Myprograms\*.cpp
Src\*.cpp
thenthecommand
addstothearchive"archive.zip"all"*.cpp"filesfromdirectories"Myprograms"and"Src".
ShortandLongFileNames7-Zipsupportsshortfilenames(likeFILENA~1.TXT)insomecases.However,it'sstronglyrecommendedtouseonlythereal(long)filenames.
ExitCodesfrom7-Zip
7-Zipreturnsthefollowingexitcodes:
Code Meaning0 Noerror
1 Warning(Nonfatalerror(s)).Forexample,oneormorefileswerelockedbysomeotherapplication,sotheywerenotcompressed.
2 Fatalerror7 Commandlineerror8 Notenoughmemoryforoperation255 Userstoppedtheprocess
CommandLineCommands
Thecommandisthefirstnon-switchargumentonthecommandline.
Commandnamesarenotcasesensitive.
SeealsoCommandLineSyntaxformoredetailsaboutusingthecommandline.
Commandsquickreference
Command Descriptiona Addb Benchmarkd Deletee Extractl Listt Testu Updatex eXtractwithfullpaths
a(Add)command
Addsfilestoarchive.
Examples7za-tziparchive.zipsubdir\
addsallfilesandsubfoldersfromfoldersubdirtoarchivearchive.zip.
7za-t7zFiles.7z*.txt-r
addsall*.txtfilesfromcurrentfolderanditssubfolderstoarchiveFiles.7z.
Switchesthatcanbeusedwiththiscommand
-i(Include)-m(Method)-p(SetPassword)-r(Recurse)-sfx(createSFX)-si(useStdIn)-so(useStdOut)-ssw(Compresssharedfiles)-t(Typeofarchive)-u(Update)-v(Volumes)-w(WorkingDir)-x(Exclude)
Seealso
Commands:d(Delete),u(Update)Switches:-u(Update)
b(Benchmark)command
MeasuresspeedoftheCPUandchecksRAMforerrors.
Syntaxb[number_of_iterations][-mmt{N}][-md{N}][-mm={Method}]
Therearetwotests:
1. CompressingwithLZMAmethod
2. DecompressingwithLZMAmethod
ThebenchmarkshowsaratinginMIPS(millioninstructionspersecond).TheratingvalueiscalculatedfromthemeasuredCPUspeedanditisnormalizedwithIntelCore2DuoE6600(2.4GHz,4MBL2)CPUin64-bitWindowswithmulti-threadingoptionswitchedoff.SoifyouhaveIntelCore2Duo,ratingvaluesmustbeclosetorealCPUfrequency.
Youcanchangetheupperdictionarysizetoincreasememoryusageby-md{N}switch.Also,youcanchangethenumberofthreadsby-mmt{N}switch.
TheDictcolumnshowsdictionarysize.Forexample,21means2^21=2MB.
TheUsagecolumnshowsthepercentageoftimetheprocessorisworking.It'snormalizedforaone-threadload.Forexample,180%CPUUsagefor2threadscanmeanthataverageCPUusageisabout90%foreachthread.
TheR/Ucolumnshowstheratingnormalizedfor100%ofCPUusage.ThatcolumnshowstheperformanceofoneaverageCPUthread.
Avrshowsaveragesfordifferentdictionarysizes.
Totshowsaveragesofthecompressionanddecompressionratings.
Compressionspeedandratingstronglydependonmemory(RAM)latency.
Decompressionspeedandratingstronglydependontheinteger
performanceoftheCPU.Forexample,theIntelPentium4hasbigbranchmispredictionpenalty(whichisaneffectofitslongpipeline)andprettyslowmultiplyandshiftoperations.So,thePentium4hasprettylowdecompressingratings.
YoucanrunaCRCcalculationbenchmarkbyspecifying-mm=crc.ThattestshowsthespeedofCRCcalculationinMB/s.Thefirstcolumnshowsthesizeoftheblock.ThenextcolumnshowsthespeedofCRCcalculationforonethread.Theothercolumnsareresultsformulti-threadedCRCcalculation.
Examples7zb
runsbenchmarking.
7zb-mmt1-md26
runsbenchmarkingwithonethreadand64MBdictionary.
7zb30
runsbenchmarkingwithdefaultsettingsfor30iterations.
d(Delete)command
Deletesfilesfromarchive.
Example7zdarchive.zip*.bak-r
deletes*.bakfilesfromarchivearchive.zip.
Switchesthatcanbeusedwiththiscommand
-i(Include)-m(Method)-p(SetPassword)-r(Recurse)-u(Update)-w(WorkingDir)-x(Exclude)
Seealso
Commands:a(Add),u(Update)
Switches:-u(Update)
e(Extract)command
Extractsfilesfromanarchivetothecurrentdirectoryortotheoutputdirectory.Theoutputdirectorycanbespecifiedby-o(SetOutputDirectory)switch.
Thiscommandcopiesallextractedfilestoonedirectory.Ifyouwantextractfileswithfullpaths,youmustusex(Extractwithfullpaths)command.
7-Zipwillprompttheuserbeforeoverwritingexistingfilesunlesstheuserspecifiesthe-y(AssumeYesonallqueries)switch.Iftheusergivesanoanswer,7-Zipwillpromptforthefiletobeextractedtoanewfilename.Thenanoanswerskipsthatfile;or,yespromptsfornewfilename.
7-Zipacceptsthefollowingresponses:
Answer Abbr. ActionYes y No n
Always a AssumeYESforALLsubsequentqueriesofthesameclass
Skip s AssumeNOforALLsubsequentqueriesofthesameclass
Quit q Quittheprogram
Abbreviatedresponsesareallowed.
Examples7zearchive.zip
extractsallfilesfromarchivearchive.ziptothecurrentdirectory.
7zearchive.zip-oc:\soft*.cpp-r
extractsall*.cppfilesfromarchivearchive.ziptoc:\softfolder.
Switchesthatcanbeusedwiththiscommand
-ai(Includearchives)-an(Disableparsingofarchive_name)-ao(Overwritemode)-ax(Excludearchives)-i(Include)-o(SetOutputDirectory)-p(SetPassword)-r(Recurse)-so(useStdOut)-x(Exclude)-y(AssumeYesonallqueries)
Seealso
Commands:x(Extractwithfullpaths)
l(Listcontentsofarchive)command
Listscontentsofarchive.
Examples7zlarchive.zip
listsallfilesfromarchivearchive.zip.
Switchesthatcanbeusedwiththiscommand
-ai(Includearchives)-an(Disableparsingofarchive_name)-ax(Excludearchives)-i(Include)-slt(Showtechnicalinformation)-p(SetPassword)-r(Recurse)-x(Exclude)
t(Testintegrityofarchive)command
Testsarchivefiles.
Example7ztarchive.zip*.doc-r
tests*.docfilesinarchivearchive.zip.
Switchesthatcanbeusedwiththiscommand
-ai(Includearchives)-an(Disableparsingofarchive_name)-ax(Excludearchives)-i(Include)-p(SetPassword)-r(Recurse)-x(Exclude)
u(Update)command
Updateolderfilesinthearchiveandaddfilesthatarenotalreadyinthearchive.
Note:Thecurrentversionof7-Zipcannotchangeanarchivewhichwascreatedwiththesolidoptionswitchedon.Toupdatea.7zarchiveyoumustcreateandupdatethatarchiveonlyinnon-solidmode(-ms=offswitch).
Example7zuarchive.zip*.doc
updates*.docfilestoarchivearchive.zip.
Switchesthatcanbeusedwiththiscommand
-i(Include)-m(Method)-p(SetPassword)-r(Recurse)-sfx(createSFX)-si(useStdIn)-so(useStdOut)-ssw(Compresssharedfiles)-t(Typeofarchive)-u(Update)-w(WorkingDir)-x(Exclude)
Seealso
Commands:a(Add),d(Delete),
Switches:-u(Update)
x(Extractwithfullpaths)command
Extractsfilesfromanarchivewiththeirfullpathsinthecurrentdirectory,orinanoutputdirectoryifspecified.
Seethee(Extract)commanddescriptionformoredeatails.
Examples7zxarchive.zip
extractsallfilesfromthearchivearchive.ziptothecurrentdirectory.
7zxarchive.zip-oc:\soft*.cpp-r
extractsall*.cppfilesfromthearchivearchive.ziptoc:\softfolder.
Switchesthatcanbeusedwiththiscommand
-ai(Includearchives)-an(Disableparsingofarchive_name)-ao(Overwritemode)-ax(Excludearchives)-i(Include)-o(SetOutputDirectory)-p(SetPassword)-r(Recurse)-so(useStdOut)-x(Exclude)-y(AssumeYesonallqueries)
Seealso
Commands:e(Extract)
CommandLineSwitches
Syntax<switch;>::=<switch_symbol><switch_characters>[<option>]
<switch_symbol>::='/'|'-'
Onthecommandline,aswitchconsistsofaswitchspecifier,eitheradash(-)oraforwardslash(/),followedbythenameoftheswitch.Switchnamescannotbeabbreviated.
Someswitchestakeanargumentaftertheswitchname.Nospacesortabsareallowedwithinaswitchspecification.Switchnamesarenotcasesensitive,butargumentscanbecasesensitive.
Switchcanbeusedinanyplaceincommandline.
SeealsoCommandLineSyntaxformoredetailsaboutusingthecommandline.
Switchquickreference
Switch Description-- Stopswitchesparsing-ai Includearchivefilenames-an Disableparsingofarchive_name-ao Overwritemode-ax Excludearchivefilenames-i Includefilenames-m SetCompressionMethod-o SetOutputdirectory-p SetPassword-r Recursesubdirectories-scs Setcharsetforlistfiles-seml Sendarchivebyemail-slp SetLargePagesmode-slt Showtechnicalinformation-sfx CreateSFXarchive-si ReaddatafromStdIn-so WritedatatoStdOut-ssc SetSensitiveCasemode-ssw Compressfilesopenforwriting-t Typeofarchive-u Updateoptions-v CreateVolumes-w SetWorkingdirectory-x Excludefilenames-y AssumeYesonallqueries
--(Stopswitchesparsing)switch
Disablesswitchparsingafter"--"onthecommandline.Thisistoallow7-Ziptousefilenamesthatstartwith"-".
Syntax--
Examples7zt---ArchiveName.7z
tests-ArchiveName.7zarchive.
-ai(Includearchivefilenames)switch
Specifiesadditionalincludearchivefilenamesandwildcards.
Multipleincludeswitchesaresupported.
Syntax-ai[<recurse_type>]<file_ref>
<recurse_type>::=r[-|0]
<file_ref>::=@{listfile}|!{wildcard}
Parameters
<recurse_type>
Specifieshowwildcardsandfilenamesinthisswitchmustbeused.Ifthisoptionisnotgiven,recursionwillbenotused.Formoredetailsseespecificationofthe-r(Recurse)switch.
<recurse_type>::=r[-|0]
<file_ref>
Specifiesfilenamesandwildcardsorlistfilethatspecifyprocessedfiles.
<file_ref>::=@{listfile}|!{wildcard}
Option Description{listfile} Specifiesnameoflistfile.SeeListfiledescription.{wildcard} Specifieswildcardorfilename.
Examples7zt-an-air!*.7z
tests*.7zarchivesincurrentdirectoryandallit'ssubdirectories.
Commandsthatcanbeusedwiththisswitch
a(Add),d(Delete),e(Extract),l(List),t(Test),u(Update),x(Extractwithfullpaths)
Seealso
Switches:-ax(Excludearchives)-an(Disableparsingofarchive_name)
-an(Disableparsingofarchive_name)switch
Disablesparsingofthearchive_namefieldonthecommandline.Thisswitchmustbeusedwiththe-ai(Includearchives)switch.Ifyouuseafilelistforyourarchives,youspecifyitwiththe-aiswitch,soyouneedtodisableparsingofarchive_namefieldfromcommandline.
Syntax-an
Examples7zt-an-ai!*.7z-ax!a*.7z
testsall*.7zarchives,excepta*.7zarchives.
Commandsthatcanbeusedwiththisswitch
e(Extract),l(List),t(Test),x(Extractwithfullpaths)
Seealso
Switches:-ai(Includearchives)-ax(Excludearchives)
-ao(Overwritemode)switch
Specifiestheoverwritemodeduringextraction,tooverwritefilesalreadypresentondisk.
Syntax-ao[a|s|t|u]
Switch Description-aoa OverwriteAllexistingfileswithoutprompt.-aos Skipextractingofexistingfiles.
-aou aUtorenameextractingfile(forexample,name.txtwillberenamedtoname_1.txt).
-aot autorenameexistingfile(forexample,name.txtwillberenamedtoname_1.txt).
Examples7zxtest.zip-aoa
extractsallfilesfromtest.ziparchiveandoverwritesexistingfileswithoutanyprompt.
Commandsthatcanbeusedwiththisswitch
e(Extract),x(Extractwithfullpaths)
Seealso
Switches:-y(assumeYesonallqueries),
-ax(Excludearchivefilenames)switch
Specifiesarchivestobeexcludedfromtheoperation.
Multipleexcludearchiveswitchesaresupported.
Syntax-ax[<recurse_type>]<file_ref>
<recurse_type>::=r[-|0]
<file_ref>::=@{listfile}|!{wildcard}
See-xi(Includearchivefilenames)switchdescriptionforinformationaboutoptionparameters.
Examples7zt-an-ai!*.7z-ax!a*.7z
testsall*.7zarchives,excepta*.7zarchives.
Commandsthatcanbeusedwiththisswitch
e(Extract),l(List),t(Test),x(Extractwithfullpaths)
Seealso
Switches:-ai(Includearchives)-an(Disableparsingofarchive_name)
-i(Includefilenames)switch
Specifiesadditionalincludefilenamesandwildcards.
Multipleincludeswitchesaresupported.
Syntax-i[<recurse_type>]<file_ref>
<recurse_type>::=r[-|0]
<file_ref>::=@{listfile}|!{wildcard}
Parameters
<recurse_type>
Specifieshowwildcardsandfilenamesinthisswitchmustbeused.Ifthisoptionisnotgiven,thentheglobalvalue,assignedbythe-r(Recurse)switchwillbeused.Formoredetailsseespecificationofthe-r(Recurse)switch.
<recurse_type>::=r[-|0]
<file_ref>
Specifiesfilenamesandwildcards,oralistfile,forfilestobeprocessed.
<file_ref>::=@{listfile}|!{wildcard}
Option Description{listfile} Specifiesnameoflistfile.SeeListfiledescription.{wildcard} Specifieswildcardorfilename.
Examples7za-tzipsrc.zip*.txt-ir!DIR1\*.cpp
addstosrc.ziparchiveall*.txtfilesfromcurrentdirectoryandall*.cppfilesfromdirectoryDIR1andfromallit'ssubdirectories.
Commandsthatcanbeusedwiththisswitch
a(Add),d(Delete),e(Extract),l(List),t(Test),u(Update),x(Extractwithfullpaths)
Seealso
Switches:-r(Recurse),-x(Exclude)
-m(SetcompressionMethod)switch
Specifiesthecompressionmethod.
Syntax-m<method_parameters>
Theformatforthisswitchdependsonthearchivetype.
Zip
Parameter Default Descriptionx=[0|1|3|5|7|9] 5 Setslevelofcompression.
m={MethodID} Deflate Setsamethod:Copy,Deflate,Deflate64,BZip2.
fb={NumFastBytes} 32 SetsnumberofFastBytesforDeflateencoder.
pass={NumPasses} 1 SetsnumberofPassesforDeflateencoder.
d={Size}[b|k|m] 900000 SetsDictionarysizeforBZip2mt=[off|on|{N}] on Setsmultithreadingmode.em={EncryptionMethodID} ZipCrypto
Setsaencryptionmethod:ZipCrypto,AES128,AES192,AES256
x=[0|1|3|5|7|9]
Setslevelofcompression.x=0meansCopymode(nocompression).
Deflate/Deflate64settings:
Level NumFastBytes NumPasses Description1
32 1Fastest
3 Fast5 Normal7 64 3 Maximum
9 128 10 Ultra
x=1andx=3withDeflatemethodsetfastmodeforcompression.
BZip2settings:
Level Dictionary NumPasses Description1 100000
1Fastest
3 500000 Fast5
900000Normal
7 2 Maximum9 7 Ultra
fb={NumFastBytes}
SetsthenumberoffastbytesfortheDeflate/Deflate64encoder.Itcanbeintherangefrom3to258(257forDeflate64).Usually,abignumbergivesalittlebitbettercompressionratioandaslowercompressionprocess.Alargefastbytesparametercansignificantlyincreasethecompressionratioforfileswhichcontainlongidenticalsequencesofbytes.
pass={NumPasses}
SetsnumberofpassesforDeflateencoder.Itcanbeintherangefrom1to15forDeflateandfrom1to10forBZip2.Usually,abignumbergivesalittlebitbettercompressionratioandaslowercompressionprocess.
d={Size}[b|k|m]
SetstheDictionarysizeforBZip2.Youmustspecifythesizeinbytes,kilobytes,ormegabytes.ThemaximumvaluefortheDictionarysizeis900000b.Ifyoudonotspecifyanysymbolfromset[b|k|m],dictionarysizewillbecalculatedasDictionarySize=2^Sizebytes.
mt=[off|on|{N}]
Setsmultithreadmode.Ifyouhaveamultiprocessorormulticoresystem,youcangetaspeedincreasewiththisswitch.ThisoptionaffectsonlycompressionwithBZip2,DeflateandDeflate64methodsanddecompressionofBZip2streams.Eachthreadinthemultithread
modeuses32MBofRAMforbuffering.Ifyouspecify{N},7-ZiptriestouseNthreads.
GZip
GZipusesthesameparametersasZip,butGZipcompressesonlywithDeflatemethod.
BZip2
Parameter Default Descriptionx=[1|3|5|7|9] 5 Setslevelofcompression.pass={NumPasses} 1 SetsnumberofPassesforBzip2encoder.mt=[off|on|{N}] on Setsmultithreadingmode.
x=[1|3|5|7|9]
Setslevelofcompression
Level NumPasses Description5 1 Defaultcompressionmethod.7 2 Maximumcompressionmethod.9 7 Ultracompressionmethod.
pass={NumPasses}
Setsthenumberofpasses.Itcanbeintherangefrom1to10.Thedefaultvalueis1fornormalmode,2formaximummodeand7forultramode.Abiggernumbercangivealittlebitbettercompressionratioandaslowercompressionprocess.
mt=[off|on|{N}]
Setsmultithreadmode.Ifyouhaveamultiprocessorormulticoresystem,youcangetaspeedincreasewiththisswitch.Ifyouspecify{N},forexamplemt=4,7-Ziptriestouse4threads.
Parameter Default Description
x=[0|1|3|5|7|9] 5 Setslevelofcompression.s=[off|on|[e][{N}f][{N}b|{N}k|{N}m|{N}g] on Setssolidmode.
f=[off|on] on Enablesordisablescompressionfiltersforexecutablefiles.
hc=[off|on] on Enablesordisablesarchiveheadercompressing.
he=[off|on] off Enablesordisablesarchiveheaderencryption.
b{C1}[s{S1}]:{C2}[s{S2}] Setsbindingbeetwencoders.{N}={MethodID}[:param1][:param2][..] LZMA Setsamethod:LZMA,PPMd,
BZip2,Deflate,BCJ,BCJ2,Copy.mt=[off|on|{N}] on Setsmultithreadingmode.
x=[0|1|5|7|9]
Setslevelofcompression
Level Method Dictionary FastBytes MatchFinder Filter Description
0 Copy Nocompression.
1 LZMA 64KB 32 HC4 BCJ Fastestcompressing
3 LZMA 1MB 32 HC4 BCJ Fastcompressing
5 LZMA 16MB 32 BT4 BCJ Normalcompressing
7 LZMA 32MB 64 BT4 BCJ Maximumcompressing
9 LZMA 64MB 64 BT4 BCJ2 Ultracompressing
s=[off|on|[e][{N}f][{N}b|{N}k|{N}m|{N}g)]
Enablesordisablessolidmode.Thedefaultmodeiss=on.Insolidmode,filesaregroupedtogether.Usually,compressinginsolidmodeimprovesthecompressionratio.
e Useaseparatesolidblockforeachnewfileextension
{N}f Setthelimitfornumberoffilesinonesolidblock
{N}b|{N}k|{N}m|{N}g
Setalimitforthetotalsizeofasolidblockinbytes
Thesearethedefaultlimitsforthesolidblocksize:
CompressionLevel Solidblocksize
Store 0BFastest 16MBFast 128MBNormal 2GBMaximum 4GBUltra 4GB
Limitationofthesolidblocksizeusuallydecreasescompressionratiobutgivesthefollowingadvantages:
Decreaseslossesincaseoffuturearchivedamage.
Decreasesextractiontimeofagroupoffiles(orjustonefile),solongasthegroupdoesn'tcontaintheentirearchive.
Thecurrentversionof7-Zipdoesn'tsupportupdatingofsolidarchives,ifitrequiresrepackingsolidblocks.
Example:
s=100f10m
setsolidmodewith100files&10MBlimitsperonesolidblock.
f=[off|on]
Enablesordisablescompressionfiltersforexecutablefiles:dll,exe,ocx,sfx,sys.ItusesBCJ2filterinUltramodeandBCJfilterinothermodes.Thedefaultmodeisf=on.
hc=[off|on]
Enablesordisablesarchiveheadercompressing.Thedefaultmodeishc=on.Ifarchiveheadercompressingisenabled,somepartsofarchiveheaderwillbecompressedwithLZMAmethod.
he=[off|on]
Enablesordisablesarchiveheaderencryption.Thedefaultmodeishe=off.
{N}
Setsorderofmethods.Itisusedalsotoassociateparameterswithmethods.Numbersmustbeginfrom0.Methodsthathavesmallernumberswillbeusedbeforeothers.
b{C1}[s{S1}]:{C2}[s{S2}]
BindsoutputstreamS1incoderC1withinputstreamS2incoderC2.Ifstreamnumberisnotspecified,streamwithnumber0willbeused.
Usallycoderhasoneinputstreamandoneoutputstream.In7zsomecoderscanhavemultipleinputandoutputstreams.
Forexample,BCJ2encoderhasoneinputstreamandfouroutputstreams.
mt=[off|on|{N}]
Setsmultithreadmode.Ifyouhaveamultiprocessorormulticoresystem,youcangetaincreasewiththisswitch.7-ZipsupportsmultithreadmodeonlyforLZMAcompressionandBZip2compression/decompression.Ifyouspecify{N},forexamplemt=4,7-Ziptriestouse4threads.LZMAcompressionusesonly2threads.
{N}={MethodID}[:param1][:param2]...[:paramN]
Setscompressionmethod.Youcanuseanynumberofmethods.ThedefaultmethodisLZMA.
Parametersmustbeinoneofthefollowingforms:
{ParamName}={ParamValue}.
{ParamName}{ParamValue},if{ParamValue}isnumberand{ParamName}doesn'tcontainnumbers.
Supportedmethods:
MethodID DescriptionLZMA AlgorithmbasedonLZalgorithmPPMd DmitryShkarin'sPPMdHwithsmallchangesBZip2 BWTalgorithmDeflate LZ+HuffmanCopy Nocompression
Supportedfilters:
MethodID DescriptionBCJ converterforx86executablesBCJ2 converterforx86executables(version2)BC_ARM converterforARM(littleendian)executables
BC_ARMThumb converterforARMThumb(littleendian)executablesBC_IA64 converterforIA-64executablesBC_PPC_B converterforPowerPC(bigendian)executablesBC_SPARC converterforSPARCexecutables
Filtersincreasethecompressionratioforsometypesoffiles.Filtersmustbeusedwithoneofthecompressionmethod(forexample,BCJ+LZMA).
LZMA
LZMAisanalgorithmbasedonLempel-Zivalgorithm.Itprovidesveryfastdecompression(about10-20timesfasterthancompression).Memoryrequirementsforcompressionanddecompressionalsoaredifferent(seed={Size}[b|k|m]switchfordetails).
Parameter Default Descriptiona=[0|1] 1 Setscompressingmoded={Size}[b|k|m] 24 SetsDictionarysize
mf={MF_ID} bt4 SetsMatchFinderfb={N} 32 SetsnumberofFastBytesmc={N} 32 SetsNumberofCyclesforMatchFinderlc={N} 3 SetsnumberofLiteralContextbits-[0,8]lp={N} 0 SetsnumberofLiteralPosbits-[0,4]pb={N} 2 SetnumberofPosBits-[0,4]
a=[0|1]
Setscompressionmode:0=fast,1=normal.Defaultvalueis1.
d={Size}[b|k|m]
SetsDictionarysizeforLZMA.Youmustspecifythesizeinbytes,kilobytes,ormegabytes.Themaximumvaluefordictionarysizeis1GB=2^30bytes.DefaultvaluesforLZMAare24(16MB)innormalmode,25(32MB)inmaximummode(-mx=7)and26(64MB)inultramode(-mx=9).Ifyoudonotspecifyanysymbolfromtheset[b|k|m],thedictionarysizewillbecalculatedasDictionarySize=2^Sizebytes.FordecompressingafilecompressedbyLZMAmethodwithdictionarysizeN,youneedaboutNbytesofmemory(RAM)available.
mf={MF_ID}
SetsMatchFinderforLZMA.Defaultmethodisbt4.Algorithmsfromhc*groupdon'tprovideagoodcompressionratio,buttheyoftenworkprettyfastincombinationwithfastmode(a=0).Memoryrequirementsdependondictionarysize(parameter"d"intablebelow).
MF_ID Memory Descriptionbt2 d*9.5+4MB BinaryTreewith2byteshashing.bt3 d*11.5+4MB BinaryTreewith3byteshashing.bt4 d*11.5+4MB BinaryTreewith4byteshashing.hc4 d*7.5+4MB HashChainwith4byteshashing.
Note:Youroperationsystemalsoneedssomeamountofphysicalmemoryforinternalpurposes.Sokeepatleast32MBofphysicalmemoryunused.
fb={N}
SetsnumberoffastbytesforLZMA.Itcanbeintherangefrom5to273.Thedefaultvalueis32fornormalmodeand64formaximumandultramodes.Usually,abignumbergivesalittlebitbettercompressionratioandslowercompressionprocess.
mc={N}
Setsnumberofcycles(passes)formatchfinder.Itcanbeinrangefrom0to1000000000.Defaultvalueis(16+number_of_fast_bytes/2)forBT*matchfindersand(8+number_of_fast_bytes/4)forHC4matchfinder.Ifyouspecifymc=0,LZMAwillusedefaultvalue.Usually,abignumbergivesalittlebitbettercompressionratioandslowercompressionprocess.Forexample,mf=HC4andmc=10000canprovidealmostthesamecompressionratioasmf=BT4.
lc={N}
Setsthenumberofliteralcontextbits(highbitsofpreviousliteral).Itcanbeinrangefrom0to8.Defaultvalueis3.Sometimeslc=4givesgainforbigfiles.
lp={N}
Setsthenumberofliteralposbits(lowbitsofcurrentpositionforliterals).Itcanbeintherangefrom0to4.Thedefaultvalueis0.Thelpswitchisintendedforperiodicaldatawhentheperiodisequalto2^value(wherelp=value).Forexample,for32-bit(4bytes)periodicaldatayoucanuselp=2.Oftenit'sbettertosetlc=0,ifyouchangelpswitch.
pb={N}
Setsthenumberofposbits(lowbitsofcurrentposition).Itcanbeintherangefrom0to4.Thedefaultvalueis2.Thepbswitchisintendedforperiodicaldatawhentheperiodisequal2^value(wherelp=value).
PPMd
PPMdisaPPM-basedalgorithm.ThisalgorithmismostlybasedonDmitryShkarin'sPPMdHsourcecode.PPMdprovidesverygood
compressionratioforplaintextfiles.Thereisnodifferencebetweencompressionspeedanddecompressionspeed.Memoryrequirementsforcompressionanddecompressionalsoarethesame.
Parameter Default Descriptionmem={Size}[b|k|m] 24 SetssizeofusedmemoryforPPMd.o={Size} 6 SetsmodelorderforPPMd.
mem={Size}[b|k|m]
SetsthesizeofmemoryusedforPPMd.Youmustspecifythesizeinbytes,kilobytes,ormegabytes.Themaximumvalueis2GB=2^31bytes.Thedefaultvalueis24(16MB).Ifyoudonotspecifyanysymbolfromtheset[b|k|m],thememorysizewillbecalculatedas(2^Size)bytes.PPMdusesthesameamountofmemoryforcompressionanddecompression.
o={Size}
SetsthemodelorderforPPMd.Thesizemustbeintherange[2,32].Thedefaultvalueis6.
BCJ2
BCJ2isaBranchconverterfor32-bitx86executables(version2).Itconvertssomebranchinstructionsforincreasingfurthercompression.
ABCJ2encoderhasoneinputstreamandfouroutputstreams:
s0:mainstream.Itrequiresfurthercompression.
s1:streamforconvertedCALLvalues.Itrequiresfurthercompression.
s2:streamforconvertedJUMPvalues.Itrequiresfurthercompression.
s3:servicestream.Itisalreadycompressed.
IfLZMAisused,thesizeofthedictionaryforstreamss1ands2canbemuchsmaller(512KBisenoughformostcases)thanthedictionarysizeforstreams0.
Examples7za-tziparchive.zip*.jpg-mx0
adds*.jpgfilestoarchive.ziparchivewithoutcompression.
7za-t7zarchive.7z*.exe*.dll-m0=BCJ-m1=LZMA:d=21-ms-mmt
adds*.exeand*.dllfilestosolidarchivearchive.7zusingLZMAmethodwith2MBdictionaryandBCJconverter.Compressionwillusemultithreadingoptimization.
7za-t7zarchive.7z*.exe*.dll-m0=BCJ2-m1=LZMA:d23-m2=LZMA:d19-m3=LZMA:d19
-mb0:1-mb0s1:2-mb0s2:3
adds*.exeand*.dllfilestoarchivearchive.7zusingBCJ2converter,LZMAwith8MBdictionaryformainoutputstream(s0),andLZMAwith512KBdictionaryfors1ands2outputstreamsofBCJ2.
7za-t7zarchive.7z*.txt-m0=PPMd
adds*.txtfilestoarchivearchive.7zusingPPMdmethod.
Commandsthatcanbeusedwiththisswitch
a(Add),d(Delete),u(Update),
Seealso
Switches:-t(setTypeofarchive),
-o(setOutputdirectory)switch
Specifiesadestinationdirectorywherefilesaretobeextracted.
Thisswitchcanbeusedonlywithextractioncommands.
Syntax-o{dir_path}
{dir_path}Thisisthedestinationdirectorypath.It'snotrequiredtoendwithabackslash.
Example7zxarchive.zip-oc:\Doc
extractsallfilesfromthearchive.ziparchivetothec:\Docdirectory.
7zx*.zip-o*
extractsall*.ziparchivestosubfolderswithnamesofthesearchives.
Commandsthatcanbeusedwiththisswitch
e(Extract),x(Extractwithfullpaths)
-p(setPassword)switch
Specifiespassword.
Syntax-p{password}
{password}Specifiespassword.
Examples7zaarchive.7z-psecret-mhe*.txt
compresses*.txtfilestoarchive.7zusingpassword"secret".Alsoitencryptsarchiveheaders(-mheswitch),sofilenameswillbeencrypted.
7zxarchive.zip-psecret
extractsallfilesfromarchive.zipusingpassword"secret".
Commandsthatcanbeusedwiththisswitch
a(Add),d(Delete),e(Extract),t(Test),u(Update),x(Extractwithfullpaths)
-r(Recursesubdirectories)switch
Specifiesthemethodoftreatingwildcardsandfilenamesonthecommandline.
Syntax-r[-|0]
Switch Description-r Enablerecursesubdirectories.
-r- Disablerecursesubdirectories.Thisoptionisdefaultforallcommands.
-r0 Enablerecursesubdirectoriesonlyforwildcardnames.
Examples7zlarchive.zip*.doc-r-
listsall*.docfilesthatbelongtothearchivedrootdirectoryinthearchive.ziparchive.
7za-tziparchive.zip-rsrc\*.cppsrc\*.h
addsall*.cppand*.hfilesfromdirectorysrcandallit'ssubdirectoriestothearchive.ziparchive.
Commandsthatcanbeusedwiththisswitch
a(Add),d(Delete),e(Extract),l(List),t(Test),u(Update),x(Extractwithfullpaths)
Seealso
Switches:-i(Include),-x(Exclude)
-scs(Setcharsetforlistfiles)switch
Setscharsetforlistfiles.
Syntax-scs{UTF-8|WIN|DOS}
DefaultcharsetisUTF-8.
UTF-8UnicodeUTF-8characterset.
WINDefaultcharactersetofWindows.
DOSDefaultDOS(OEM)charactersetofWindows.
compressesfilesfromlistfile.txtlist,thatcontainslistoffilesindefaultcharactersetofWindows.
Commandsthatcanbeusedwiththisswitch
a(Add),u(Update)
-seml(Sendarchivebyemail)switch
Sendsanarchivebye-mail.
Syntax-seml[.]
[.]Causesthearchivetobedeletedafterattachingacopyofittotheemailmessage.
Example7zaarchive.7z-semla.txt
compressesthea.txtfileandsendsitinarchive.7zbyemail.
Commandsthatcanbeusedwiththisswitch
a(Add),u(Update)
-sfx(CreateSFXarchive)switch
Createsselfextractingarchive.
Syntax-sfx[{SFX_Module}]
{SFX_Module}
SpecifiestheSFXmodulethatwillbecombinedwiththearchive.Thismodulemustbeplacedinthesamedirectoryasthe7z.exe.If{SFX_Module}isnotassigned,7-ZipwillusestandardconsoleSFXmodule7zCon.sfx.
SFX_Module Description7z.sfx Windowsversion.7zCon.sfx Consoleversion.7zS.sfx Windowsversionforinstallers.7zSD.sfx Windowsversionforinstallers(usesMSVCRT.dll).
AllSFXmodulesareuncompressed.YoucanuseUPXprogram(http://upx.sourceforge.net)tocompressssuchmodules.AftercompressingbytheUPXprogram,thesizeofthesfxmodulewillbereducedto40-50%ofitsoriginalsize.
SFXmodulesforinstallers
SFXmodulesforinstallersareincludedinanexternalpackage(7z_extra).Youcandownloadthesemodulesfromwww.7-zip.org.SFXmodulesforinstallers(7zS.sfxand7zSD.sfx)allowyoutocreateyourowninstallationprogram.Suchamoduleextractsthearchivetotheuser'stempfolder,andrunsaspecifiedprogram,andremovesthetempfilesaftertheprogramfinishes.Aself-extractingarchiveforinstallersmustbecreatedasjoining3files:SFX_Module,Installer_Config,7z_Archive.Inaddition,anoptionalfile,Installer_Config,isallowed.Youcanusethefollowingcommandtocreateaninstallerself-extractingarchive:
copy/b7zS.sfx+config.txt+archive.7zarchive.exe
Anoptimallysmallinstallationpackagesizecanbeachieved,iftheinstallationfilesareuncompressedbeforeincludingtheminthe7zarchive.
-yswitchforinstallermodulespecifiesquietmodeextraction.
InstallerConfigfileformat
ThisconfigfilecontainscommandsfortheInstaller.Thefilebeginswiththestring;!@Install@!UTF-8!andendswith;!@InstallEnd@!.ThefilemustbewritteninUTF-8encoding.Thefilecontainsanyorallthesestringpairs:
ID_String="Value"
ID_String DescriptionTitle TitleformessagesBeginPrompt BeginPromptmessageProgress Valuecanbe"yes"or"no".Defaultvalueis"yes".
RunProgramCommandforexecuting.Defaultvalueis"setup.exe".Substring%%Twillbereplacedwithpathtotemporaryfolder,wherefileswereextracted
Directory Directoryprefixfor"RunProgram".Defaultvalueis".\\"
ExecuteFile NameoffileforexecutingExecuteParameters Parametersfor"ExecuteFile"
Youmayomitanypair.
Therearetwowaystorunainstallationprogram:RunProgramandExecuteFile.UseRunProgram,ifyouwanttorunaprogramfromthe.7zarchive.UseExecuteFile,ifyouwanttoopenadocumentfromthe.7zarchive,orifyouwanttoexecuteacommandfromWindows.
IfyouuseRunProgram,andifyouspecifyemptydirectoryprefix:Directory="",thesystemsearchesfortheexecutablefileinthefollowingsequence:
1. Thedirectoryfromwhichtheapplication(installer)loaded.
2. Thetemporaryfolder,wherefileswereextracted.
3. TheWindowssystemdirectory.
ConfigfileExamples;!@Install@!UTF-8!
Title="7-Zip4.00"
BeginPrompt="Doyouwanttoinstallthe7-Zip4.00?"
RunProgram="setup.exe"
;!@InstallEnd@!
;!@Install@!UTF-8!
Title="7-Zip4.00"
BeginPrompt="Doyouwanttoinstallthe7-Zip4.00?"
ExecuteFile="7zip.msi"
;!@InstallEnd@!
;!@Install@!UTF-8!
Title="7-Zip4.01Update"
BeginPrompt="Doyouwanttoinstallthe7-Zip4.01Update?"
ExecuteFile="msiexec.exe"
ExecuteParameters="/i7zip.msiREINSTALL=ALLREINSTALLMODE=vomus"
;!@InstallEnd@!
Examples7za-sfxa.exe*.txt
adds*.txtfilestoselfextractingarchivea.exeusingthedefaultconsoleSFXmodule.
7za-sfx7z.sfxa.exe*
addsallfilestoselfextractingarchivea.exewithmodule7z.sfxusingwindowsversionofSFXmudule.
Commandsthatcanbeusedwiththisswitch
a(Add),d(Delete),u(Update),
-si(readdatafromstdin)switch
Causes7-Ziptoreaddatafromstdin(standardinput)insteadoffromdiscfiles.
Syntax-si{file_name}
{file_name}Specifiesanamethatwillbestoredinthearchiveforthecompresseddata.Iffile_nameisnotspecified,datawillbestoredwithoutaname.
Note:Thecurrentversionof7-Zipdoesnotsupportreadingofarchivesfromstdin.
Example7zaarchive.gz-tgzip-siDoc2.txt<Doc.txt
compressesinputstreamfromfileDoc.txttoarchive.gzarchiveusingDoc2.txtfilename.
Commandsthatcanbeusedwiththisswitch
a(Add),u(Update)
-so(writedatatostdout)switch
Causes7-Ziptowriteoutputdatatostdout(standardoutputstream).
Syntax-so
Examples7zxarchive.gz-so>Doc.txt
decompressesarchive.gzarchivetooutputstreamandthenredirectsthatstreamtoDoc.txtfile.
7zadummy-tgzip-soDoc.txt>archive.gz
compressestheDoc.txtfiletothe7-Zipstandardoutputstreamandwritesthatstreamtoarchive.gzfile.
Commandsthatcanbeusedwiththisswitch
a(Add),e(Extract),u(Update),x(Extractwithfullpaths)
-slp(SetLargePagesmode)switch
SetsLargePagesmode.
Syntax-slp[-]
Switch Description-slp EnablesLargePagesmode.
-slp- DisablesLargePagesmode.Thisoptionisdefaultforallcommands.
LargePagesmodeincreasesthespeedofcompression.However,thereisapauseatthestartofcompressionwhile7-Zipallocatesthelargepagesinmemory.If7-Zipcan'tallocatelargepages,itallocatesusualsmallpages.Also,theWindowsTaskManagerdoesn'tshowtherealmemoryusageoftheprogram,if7-Zipuseslargepages.ThisfeatureworksonlyonWindows2003/XPx64/Vista.Also,itrequiresadministrator'srightsforyoursystem.TherecommendedsizeofRAMforthisfeatureis1GBormore.Toinstallthisfeature,youmustrunthe7-ZipFileManageratleastonce,closeit,andthenrebootthesystem.
Yoursystemcanhangforseveralsecondsatcompressingstarting,ifyouuse-slpmode.Soit'snotrecommendedtouse-slpmodetocompresssmalldatasets(lessthan100MB).
Example7zaarchive.7z-slpa.iso
compressesa.isofilewithLargePagesmodeswitchedon.
-slt(Showtechnicalinformation)switch
Setstechnicalmodeforl(List)command.
Syntax-slt
Example7zl-sltarchive.7z
showsdetailedtechnicalinformationforthefilesinarchive.7z.
Commandsthatcanbeusedwiththisswitch
l(List)
-ssc(SetSensitiveCasemode)switch
Setssensitivecasemodeforfilenames.
Syntax-scs[-]
Switch Description-ssc Setcase-sensitivemode.It'sdefaultforPosix/Linuxsystems.-ssc- Setcase-insensitivemode.It'sdefaultforWindowssystems.
Example7zaarchive.7zA*.txt-ssc-r
compressesallA*.txtfilesfromcurrentdirectoryandallit'ssubdirectories.Thatcommanddoesn'tcompressa*.txtfiles.
Commandsthatcanbeusedwiththisswitch
a(Add),d(Delete),e(Extract),l(List),t(Test),u(Update),x(Extractwithfullpaths)
-ssw(Compressfilesopenforwriting)switch
Compressesfilesopenforwritingbyanotherapplications.Ifthisswitchisnotset,7-zipdoesn'tincludesuchfilestoarchive.
Syntax-ssw
Example7zaarchive.7z-ssw*.txt
compressesall*.txtfilesincurrentfolderincludingfilesopenforwritingbyanotherapplications.
Commandsthatcanbeusedwiththisswitch
a(Add),u(Update)
-t(setTypeofarchive)switch
Specifiesthetypeofarchive.
Syntax-t{archive_type}
{archive_type}Specifiesthetypeofarchive.Itcanbe:7z,zip,gzip,bzip2,ortar.7zformatisthedefault.
Note:gziporbzip2formatssupportonlyonefileperarchive.Ifyouwanttocompressmorethanonefiletotheseformats,createatararchivefirst,andthencompressitwithyourselectedformat.
Example7za-tziparchive.zip*.txt
addsall*.txtfilesfromcurrentdirectorytoziparchivearchive.zip.
Commandsthatcanbeusedwiththisswitch
a(Add),u(Update)
-u(Updateoptions)switch
Specifieshowtoupdatefilesinanarchiveand(or)howtocreatenewarchives.
Syntax-u[-]<action_set>[!{new_archive_name}]
<action_set>::=<state_action>...
<state_action>::=<state><action>
<state>::=p|q|r|x|y|z|w
<action>::=0|1|2|3
Parameters
dash(-)
Disablesanyupdatesinthebasearchive.
Thetermbasearchivemeansthearchiveassignedby"base_archive_name"onthecommandline.SeeCommandlinesyntaxformoredetails.
{new_archive_name}
Specifiesthepathnameofthenewarchivetobecreated.Alloptionsinthisswitchwillrefertothisnewarchive.
Ifnotassigned,thenalloptionsinthisswitchwillrefertothebasearchiveofthecommand.
<state>
Specifiesthestateofaparticularfiletobeprocessed.
<state>::=p|q|r|x|y|z|w
Foreachuniquefilenamethereare6variantsofstate:
<state> Statecondition FileonDisk FileinArchive
p Fileexistsinarchive,butisnotmatchedwithwildcard. Exists,butis
notmatched
q Fileexistsinarchive,butdoesn'texistondisk. Doesn'texist Exists
r Filedoesn'texistinarchive,butexistsondisk. Exists Doesn'texist
x Fileinarchiveisnewerthanthefileondisk. Older Newer
y Fileinarchiveisolderthanthefileondisk. Newer Older
z Fileinarchiveissameasthefileondisk Same Same
wCannotbedetectedwhatfileisnewer(timesarethesame,sizesaredifferent)
? ?
<action>
Specifiestheactionforagiven<state>.
<action>::=0|1|2|3
Foreachstateyoucanspecifyoneofthethreevariantsofactions:
<action> Description0 Ignorefile(don'tcreateiteminnewarchiveforthisfile)1 Copyfile(copyfromoldarchivetonew)2 Compress(compressfilefromdisktonewarchive)
3CreateAnti-item(itemthatwilldeletefileordirectoryduringextracting).Thisfeatureissupportedonlyin7zformat.
Remarks
Anyupdatecommand(suchasa(Add),d(Delete),u(Update))canbeassignedintheseterms.
Thefollowingtableshowsactionsetsforupdatecommands.
command\<state> p q r x y z wd(Delete) 1 0 0 0 0 0 0a(Add) 1 1 2 2 2 2 2
u(Update) 1 1 2 1 2 1 2Synchronize 1 0 2 1 2 1 2
Ifyoudon'tspecifya!{new_archive_name}option,thenalloptionswillrefertothemainarchive(thearchiveassignedonthecommandlineafterthe7zcommand).Ifyouspecify!{new_archive_name}option,then7-Zipalsowillcreateanewarchivewiththespecifiednameandalloptionswillrefertothatnewarchive.
Multipleupdateswitchesaresupported.7-Zipcancreateanynumberofnewarchivesduringoneoperation.
Bydefault,theactionsetforeachnewarchiveisassignedastheactionsetofthemaincommand.Thereare3differentactionsetsforcommands:a(Add),d(Delete),u(Update).Youcanoverloadany<state_action>pair.
Timezonenotes
Ifyouchangetimezone(whenyoumoveyourcomputertoanothertimezoneorifthereareclockchangesfordaylightsavinginyourzone),youcanhavesomeproblemswithupdatecommandsthatdependfromfile'smodificationtime.It'sstronglyrecommendedtouseonlyfilesystemthatusesCoordinatedUniversalTime(UTC)andarchiveformatthatalsousesUTC.Inthatcaseyouwillhavenoproblemswithtimezonechanges.Alsoit'srecommendedtouseonlyUTCformatsinothercases,forexample,ifyousendfilestosomeoneinanothertimezone.
Alsoinsomecasestherearenoproblems,ifbothfilesystemandarchiveformatuselocaltime,forexample,FATfilesystemandZIPformat.
UTCfilesystems:NTFS
UTCarchiveformats:7z,tar,gzip2,iso,wim
Localtimefilesystems:FAT,FAT32
Localtimearchiveformats:rar,zip,cab
Examples7zuc:\1\exist.7z-u--up0q3x2z0!c:\1\update.7z*
createsanewarchiveupdate.7zandwritestothisarchiveallfilesfromcurrentdirectorywhichdifferfromfilesinexist.7zarchive.exist.7zarchivewillnotbechanged.
7zuc:\1\exist.7z-up0q3x2z0!c:\1\update.7z*-ms=off
createsanewarchiveupdate.7zandwritestothisarchiveallfilesfromthecurrentdirectorywhichdifferfromfilesinexist.7zarchive.
Note:Thecurrentversionof7-Zipcannotchangeanarchivecreatedwiththesolidoptionswitchedon.Toupdatea.7zarchive,youmustcreateandupdatethearchiveinnon-solidmode(-ms=offswitch).
Commandsthatcanbeusedwiththisswitch
a(Add),d(Delete),u(Update),
-v(CreateVolumes)switch
Specifiesvolumesizes.
Syntax-v{Size}[b|k|m|g]
{Size}[b|k|m|g]SpecifiesvolumesizeinBytes,Kilobytes(1Kilobyte=1024bytes),Megabytes(1Megabyte=1024Kilobytes)orGigabytes(1Gigabyte=1024Megabytes).ifyouspecifyonly{Size},7-zipwilltreatitasbytes.
It'spossibletospecifyseveral-vswitches.
NOTE:Pleasedon'tusevolumes(anddon'tcopyvolumes)beforefinishingarchiving.7-Zipcanchangeanyvolume(includingfirstvolume)attheendofarchivingoperation.
Examples7zaa.7z*.txt-v10k-v15k-v2m
createsmultivolumea.7zarchive.Firstvolumewillbe10KB,secondwillbe15KB,andallotherswillbe2MB.
Commandsthatcanbeusedwiththisswitch
a(Add),
-w(setWorkingdirectory)switch
Setstheworkingdirectoryforthetemporarybasearchive.Bydefault,7-Zipbuildsanewbasearchivefileinthesamedirectoryastheoldbasearchivefile.Byspecifyingthisswitch,youcansettheworkingdirectorywherethetemporarybasearchivefilewillbebuilt.Afterthetemporarybasearchivefileisbuilt,itiscopiedovertheoriginalarchive;then,thetemporaryfileisdeleted.
Syntax-w[{dir_path}]
{dir_path}
Specifiesthedestinationdirectorypath.It'snotrequiredthatapathendwithabackslash.
If<dir_path>isnotassigned,then7-ZipwillusetheWindowstemporarydirectory.
Example7za-tziparchive.zip*.cpp-wc:\temp
adds*.cppfilestothearchive.ziparchive,creatingatemporaryarchiveinc:\tempfolder.
Commandsthatcanbeusedwiththisswitch
a(Add),d(Delete),u(Update),
-x(Excludefilenames)switch
Specifieswhichfilenamesorwildcardednamesmustbeexcludedfromtheoperation.
Multipleexcludeswitchesaresupported.
Syntax-x[<recurse_type>]<file_ref>
<recurse_type>::=r[-|0]
<file_ref>::=@{listfile}|!{wildcard}
See-i(Include)switchdescriptionforinformationaboutoptionparameters.
Examples7za-tziparchive.zip*.txt-x!temp.*
addstothearchivearchive.zipall*.txtfiles,excepttemp.*files.
Commandsthatcanbeusedwiththisswitch
a(Add),d(Delete),e(Extract),l(List),t(Test),u(Update),x(Extractwithfullpaths)
Seealso
Switches:-r(Recurse),-i(Include)
-y(assumeYesonallqueries)switch
Disablesmostofthenormaluserqueriesduring7-Zipexecution.Youcanusethisswitchtosuppressoverwritequeriesinthee(Extract)andx(Extractwithfullpaths)commands.
Syntax-y
Examples7zxsrc.zip-y
extractsallfilesfromsrc.ziparchive.Alloverwritequerieswillbesuppressedandfilesondiskwithsamefilenamesasinarchivewillbeoverwritten.
Commandsthatcanbeusedwiththisswitch
e(Extract),x(Extractwithfullpaths)
Seealso
Switches:-ao(Overwritemode),
MenuItemsNote:'Grey'referstothenumerickeypad.
File
Menuitem Shortcut Description
System Submenuwithmenucommandsfromsystemshell
Open Enter OpencurrentitemOpenInside Ctrl+PgDn Opencurrentitemasfolderinside7-ZipOpenOutside Shift+Enter OpencurrentiteminnewwindowEdit F4 OpenselecteditemwitheditorRename F2 RenameselecteditemCopyTo... F5 CopyselecteditemsMoveTo... F6 MoveselecteditemsDelete Delete DeleteselecteditemsSplitfile... SplitfiletopartsCombinefiles... CombinefilestoonefileComment Ctrl+Z SetcommentforfileCalculatechecksum CalculatesCRCchecksumforfiles
CreateFolder F7 CreatenewfolderCreateFile Shift+F4 CreatesnewfileExit Alt+F4 Closestheprogram.
Edit
MenuItem Shortcut Description
SelectAll Shift+[Grey+] Selectallitems
DeselectAll Shift+[Grey-] Selectallitems
InvertSelection
[Grey*] Select/Deselectallitems
Select... [Grey+] SelectspecifieditemsDeselect... [Grey-] DeselectspecifieditemsSelectbyType
Alt+[Grey+]
Selectallitemswiththesameextensionascurrentitem
DeselectbyType
Alt+[Grey-]
Deselectallitemswiththesameextensionascurrentitem
View
MenuItem Shortcut DescriptionLargeIcons Ctrl+1 DisplaysitemsbyusinglargeiconsSmallIcons Ctrl+2 DisplaysitemsbyusingsmalliconsList Ctrl+3 Displaysitemsinalist
Details Ctrl+4 Displaysitemsinalistwithdetailedinformationabouteachitem
Name Ctrl+F3 SortitemsbyNameType Ctrl+F4 SortitemsbyTypeDate Ctrl+F5 SortitemsbyDateSize Ctrl+F6 SortitemsbySizeUnsorted Ctrl+F7 DonotsortitemsFlatView SwitchFlatviewmodeforlistoffiles2Panels F9 SwitchOn/OffsecondpanelToolbars MenuitemsfortoolbarshandlingOpenRootFolder \ Openrootcomputerfolder
UpOneLevel Backspace Openthefolderonelevelup
FoldersHistory... Alt+F12 Openfoldershistory
Refresh Ctrl+R Refreshitemslist
Options
MenuItem Shortcut DescriptionOptions... OpenOptionsdialogbox
Favorites
MenuItem Shortcut DescriptionAddfoldertoFavoritesas Addsfoldertofavorities
Help
MenuItem Shortcut DescriptionContents... F1 Opens7-ZipHelpAbout7-Zip... OpensAboutdialogbox
Miscellaneouscommands
Shortcut DescriptionTab SwitchbetweenpanelsInsert Select/DeselectcurrentitemShift+F10 DisplaytheshortcutmenufortheselecteditemsRightCtrl+0Alt+0...RightCtrl+9Alt+9
Openfolderbookmark
Shift+RightCtrl+0Shift+Alt+0...Shift+RightCtrl+9Shift+Alt+9
Createsfolderbookmark
Alt+F1 EdittheFolderAddressonleftpanelAlt+F2 EdittheFolderAddressonrightpanelCtrl+[Grey+] AdjustoptimalcolumnwidthforitemsAlt+Up OpensamefolderinotherpanelAlt+Left,Alt+Right Opencurrentfolderinotherpanel
KeyboardShortcuts
Key Normal Ctrl Alt Shift
Tab Switchpanel
F1 Help LeftPathF2 Rename RightPathF3 View SortbyNameF4 Edit SortbyType Exit CreateFileF5 Copy SortbyDateF6 Move SortbySize
F7 CreateFolder Unsorted
F9 1/2Panels
F10 Menu ShortcutMenu
F12 FoldersHistory
0-9 R:FolderBookmark
FolderBookmark
A SelectAllN CreateFileR RefreshZ Comment
BackspaceUpOneLevel
Enter Open Properties Openoutside
Insert SelectItemDelete DeleteItemPageDown OpenInside
PageUp UpOneLevelOpensame
Up folder
Left Opencurrentfolder
Right Opencurrentfolder
\ OpenrootGrey/ OpenrootGrey* SelectAllGrey+ Select Adjustcolumns SelectbyType SelectAll
Grey- Deselect DeselectbyType DeselectAll