RAR is a tool for managing archive files in RAR format. It allows users to create, extract, and modify archive files. RAR features include high compression levels, file recovery features, self-extracting archives, and password protection. The manual describes the various RAR commands for adding, extracting, listing, testing, and modifying archive files. Configuration options and environment variables allow customizing RAR's default behavior.
Vani Magazine - Quarterly Magazine of Seshadripuram Educational Trust
User
1. User's Manual
~~~~~~~~~~~~~
RAR4.01 console version
~~~~~~~~~~~~~~~~~~~~~~~~
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Welcome tothe RARArchiver!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Introduction
~~~~~~~~~~~~
RAR isa powerful tool allowingyoutomanage and control archive
files.Console RARsupportsarchivesonlyinRARformat,the names
of whichusuallyhave a".rar" extension.ZIPandotherformats
are not supported.WindowsusersmayinstallGUIRAR version - WinRAR,
whichisable to processmanymore archive types.
RARfeaturesinclude:
* Highlysophisticated,original compressionalgorithm
* Special compressionalgorithmsoptimizedfortext,audio,
graphicsdata, 32 and 64-bit Intel executables
* Bettercompressionthansimilartools,using'solid'archiving
* Authenticityverification(registeredversiononly)
2. * Self-extractingarchivesandvolumes(SFX)
* Abilitytorecoverphysicallydamagedarchives
* Locking,password,file orderlist,file security&more ...
Configurationfile
~~~~~~~~~~~~~~~~~~
RARfor Unix readsconfigurationinformationfromthe file.rarrc
inthe user'shome directory(storedinHOME environmentvariable)
or in/etc directory.
RARfor Windowsreadsconfigurationinformationfromthe filerar.ini,
placedinthe same directoryas the rar.exe file.
Thisfile maycontainthe followingstring:
switches=anyRARswitches,separatedbyspaces
For example:
switches=-m5-s
Environmentvariable
3. ~~~~~~~~~~~~~~~~~~~~
Defaultparametersmaybe addedtothe RAR command line byestablishing
an environmentvariable "RAR".
For instance,inUnix followinglinesmaybe addedtoyourprofile:
RAR='-s-md1024'
exportRAR
RAR will use thisstringasdefaultparametersinthe commandline and
will create "solid"archiveswith1024 KB slidingdictionarysize.
RAR handlesoptionswithpriorityasfollowing:
commandline switches highestpriority
switchesinthe RARvariable lowerpriority
switchessavedinconfigurationfile lowestpriority
Log file
~~~~~~~~
If the switch -ilogisspecifiedinthe commandline orconfiguration
file,RARwill writeinformational messages,concerningerrors
4. encounteredwhileprocessingarchives,intoalogfile.Readswitch
-ilogdescriptionformore details.
The file orderlistforsolidarchiving - rarfiles.lst
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rarfiles.lstcontainsauser-definedfilelist,whichtellsRAR
the orderin whichtoadd filestoa solidarchive.Itmaycontain
file names,wildcardsandspecial entry - $default.The default
entrydefinesthe place inorderlistforfilesnotmatched
withotherentriesinthisfile.The commentcharacteris';'.
InWindowsthisfile shouldbe placedinthe same directoryasRAR
or in%APPDATA%WinRARdirectory,inUnix - tothe user'shome directory
or in/etc.
Tipsto provide improvedcompressionandspeedof operation:
- similarfilesshouldbe groupedtogetherinthe archive;
- frequentlyaccessedfilesshouldbe placedatthe beginning.
Normallymasksplacednearertothe topof listhave a higherpriority,
butthere isan exceptionfromthisrule.If rarfiles.lstcontainssuch
twomasksthat all filesmatchedbyone maskare alsomatchedby another,
5. that maskwhichmatchesa smallersubsetof file nameswill have higher
priorityregardlessof itspositioninthe list.Forexample,if youhave
*.cpp and f*.cpp masks,f*.cpphas a higherpriority,sothe positionof
'filename.cpp'will be chosenaccordingto'f*.cpp',not '*.cpp'.
RAR commandline syntax
~~~~~~~~~~~~~~~~~~~~~~~
Syntax
RAR <command> [ -<switches>] <archive> [ <@listfiles...>]
[ <files...>] [ <path_to_extract>]
Description
Commandline options(commandsandswitches) provide control of
creatingand managingarchiveswithRAR.The commandisa string(ora
single letter) whichcommandsRARtoperforma correspondingaction.
Switchesare designedtomodifythe wayRARperformsthe action.Other
parametersare archive name and filestobe archivedintoorextracted
from the archive.
Listfilesare plaintextfilesthatcontainnamesof filestoprocess.
File namesshouldstartat the firstcolumn.Itis possible to
6. put commentstothe listfile after//characters.For example,
you maycreate backup.lstcontainingthe followingstrings:
c:workdoc*.txt //backuptextdocuments
c:workimage*.bmp //backuppictures
c:workmisc
and thenrun:
rar a backup@backup.lst
If youwishto readfile namesfromstdin(standardinput),
specify the emptylistfile name (just@).
By default,Windowsconsole RARusesOEM(DOS) encodinginlistfiles.
but it can be redefinedwith -sc<charset>l switch.
You may specifybothusual file namesandlistfilesinthe same
commandline.If neitherfilesnorlistfilesare specified,
then*.* isimpliedandRARwill processall files
In Unix you needtoenclose RARcommandline parameterscontaining
wildcardsinsingle ordouble quotestopreventtheirexpansion
by Unix shell.Forexample,thiscommandwillextract*.asmfiles
from all *.rar archivesincurrent directory:
7. rar e '*.rar' '*.asm'
Commandcouldbe any of the following:
a Addfilestoarchive.
Examples:
1) add all *.hlpfilesfromthe currentdirectoryto
the archive help.rar:
rar a help*.hlp
2) archive all filesfromthe currentdirectoryandsubdirectories
to 362000 bytessize solid,self-extractingvolumes
and addthe recoveryrecordtoeach volume:
rar a -r -v362 -s -sfx -rrsave
Because nofile namesare specified,all files(*) are assumed.
3) as a special exception,if directoryname is specifiedas
an argumentandif directoryname doesnotinclude file masks
8. and trailingbackslashes,the entire contentsof the directory
and all subdirectorieswill be addedtothe archive even
if switch -r isnot specified.
The followingcommandwill addall filesfromthe directory
Bitmapsandits subdirectoriestothe RARarchive Pictures.rar:
rar a Pictures.rarBitmaps
4) if directoryname includesfile masksortrailingbackslashes,
normal rulesapplyandyouneedto specifyswitch -rtoprocess
itssubdirectories.
The followingcommandwill addall filesfromdirectoryBitmaps,
butnot from itssubdirectories,becauseswitch -risnot
specified:
rar a Pictures.rarBitmaps*
c Addarchive comment.Commentsare displayedwhilethe archive is
beingprocessed.Commentlength islimitedto62000 bytes
Examples:
9. rar c distrib.rar
Alsocommentsmaybe addedfroma file using -z[file] switch.
The followingcommandaddsacommentfrominfo.txtfile:
rar c -zinfo.txtdummy
cf Addfilescomment.File commentsare displayedwhenthe 'v'
commandisgiven.File commentlengthislimitedto32767 bytes.
Example:
rar cf bigarch *.txt
ch Change archive parameters.
Thiscommandcan be usedwithmostof archive modification
switchestomodifyarchive parameters.Itisespecially
convenientforswitcheslike-av, -cl, -cu, -tl,whichdonot
have a dedicatedcommand.
It isnot able to recompress,encryptordecryptarchive data
and itcannot merge or create volumes.If usedwithoutany
10. switches,'ch'commandjustcopiesthe archive data without
modification.
Example:
Setarchive time tolatestfile:
rar ch -tl files.rar
cw Write archive commenttospecifiedfile.
Formatof outputfile dependson -scswitch.
If outputfile name isnotspecified,commentdatawill be
sentto stdout.
Examples:
1) rar cw arc comment.txt
2) rar cw -scucarc unicode.txt
3) rar cw arc
11. d Delete filesfromarchive.Please note if the processingof this
commandresultsinremovingall the filesfromthe archive,
the emptyarchive wouldremoved.
e Extract filestocurrentdirectory.
f Freshenfilesinarchive.Updatesthose fileschangedsince they
were packedtothe archive.Thiscommandwill notadd new files
to the archive.
i[i|c|h|t]=<string>
Findstringinarchives.
Supportsfollowingoptional parameters:
i - case insensitive search(default);
c - case sensitive search;
h - hexadecimal search;
12. t - use ANSI,Unicode andOEMcharacter tables(Windowsonly);
If no parametersare specified,itispossibletouse
the simplifiedcommandsyntax i<string>insteadof i=<string>
It isallowedtospecify't'modifierwithotherparameters,
forexample,ict=stringperformscase sensitivesearch
usingall mentionedabove charactertables.
Examples:
1) rar "ic=firstlevel" -rc:*.rar *.txt
Performcase sensitivesearchof "firstlevel"string
in*.txt filesin*.rararchivesonthe diskc:
2) rar ih=f0e0aeaeab2d83e3a9-re:texts
Searchfor hex stringf0 e0 ae ae ab 2d 83 e3 a9
inrar archivesine:textsdirectory.
k Lock archive.Anycommandwhichintendstochange the archive
will be ignored.
13. Example:
rar k final.rar
l[t,b] Listcontentsof archive [technical].Filesare listedaswith
the 'v' command withthe exceptionof the filepath.i.e.only
the file name isdisplayed.Optional technical information
(hostOS,solidflagandoldversionflag) isdisplayed
when't' modifierisused.Modifier'b'forcesRARto output
onlybare file nameswithoutanyadditional information.
m[f] Move to archive [filesonly].Movingfilesanddirectories
resultsinthe filesanddirectoriesbeingerasedupon
successful completionof the packingoperation.Directorieswill
notbe removedif 'f'modifierisusedand/or'-ed'switchis
applied.
p Printfile tostdout.
You mayuse thiscommandtogetherwith -inul switchtodisable
all RAR messagesandprintonlyfile data.Itmaybe important
whenyouneedtosenda file tostdoutfor use inpipes.
14. r Repairarchive.Archive repairingisperformedintwostages.
First,the damagedarchive issearchedfora recoveryrecord
(see 'rr' command).If the archive containsa recoveryrecord
and if the portionof the damageddata is continuousandless
thanN*512 bytes,where N isnumberof recoverysectorsplaced
intothe archive,the chance of successful archive
reconstructionisveryhigh.Whenthisstage hasbeencompleted,
a newarchive will be created,calledfixed.arcname.rar,
where 'arcname'isthe original (damaged) archive name.
If a brokenarchive doesnotcontaina recoveryrecordor if
the archive isnot completelyrecovereddue tomajordamage,
a secondstage is performed.Duringthisstage onlythe archive
structure isreconstructedandit isimpossibletorecover
fileswhichfail the CRCvalidation,itisstill possible,
however,torecoverundamagedfiles,whichwereinaccessible
due to the brokenarchive structure. Mostlythisisuseful
fornon-solidarchives.Thisstage isneverefficientfor
archiveswithencryptedfile headers,whichcanbe repaired
onlyif recoveryrecordispresent.
Whenthe secondstage iscompleted,the reconstructedarchive
will be savedasrebuilt.arcname.rar,where'arcname'is
15. the original archive name.
While the recoveryisinprogress,RARmaypromptthe userfor
assistance whenasuspiciousfile isdetected.
Suspiciousentry
Name: <possiblyfilename>
Size: <size> Packed:<compressedsize>
Addit: Yes/No/All
Answer'y'to add thisentryto the file rebuilt.arcname.rar.
Example:
rar r buggy.rar
rc Reconstructmissinganddamagedvolumesusingrecoveryvolumes
(.revfiles).Youneedtospecifyanyexistingvolume
as the archive name,forexample,'rarrc backup.part03.rar'
Read'rv' commanddescriptionforinformationabout
recoveryvolumes.
16. rn Rename archivedfiles.
The commandsyntax is:
rar rn <arcname> <srcname1> <destname1>...<srcnameN><destnameN>
For example,the followingcommand:
rar rn data.rarreadme.txtreadme.bakinfo.txtinfo.bak
will rename readme.txttoreadme.bakandinfo.txttoinfo.bak
inthe archive data.rar.
It isallowedtouse wildcardsinthe source anddestination
namesforsimple name transformationslikechangingfile
extensions.Forexample:
rar rn data.rar*.txt *.bak
will rename all *.txtfilesto*.bak.
RAR doesnotcheckif the destinationfile name isalready
presentinthe archive,soyouneedtobe careful toavoid
17. duplicatednames.Itisespeciallyimportantwhenusing
wildcards.Sucha commandispotentiallydangerous,because
a wrongwildcardmaycorrupt all archivednames.
rr[N] Adddata recoveryrecord.Optionally,redundantinformation
(recoveryrecord) maybe addedtoan archive.Thiswill cause
a small increase of the archive size andhelpstorecover
archivedfilesincase of diskfailure ordatalossesof
any otherkind,providedthatthe damage isnottoo severe.
A recoveryrecordcontainsupto 524288 recoverysectors.
The numberof sectorsmay be specifieddirectlyinthe 'rr'
command(N = 1, 2 .. 524288) or, if it isnot specifiedby
the user,itwill be selectedautomaticallyaccordingtothe
archive size:asize of the recoveryinformationwill be about
1% of the total archive size,usuallyallowingthe recoveryof
up to 0.6% of the total archive size of continuouslydamageddata.
It isalsopossible tospecifythe recoveryrecordsize in
percenttothe archive size.Justappendthe percentcharacter
to the commandparameter.Forexample:
rar rr3% arcname
18. Note thatif yourun thiscommandfrom.bat or .cmd file,
youneedto use rr3%% insteadof rr3%,because the command
processortreatsthe single '%'character as the start of
a batch file parameter.You mayalsouse 'p' insteadof '%',
so 'rr3p' will worktoo.
If data is damagedcontinuously,theneachrr-sectorhelpsto
recover512 bytesof damagedinformation.Thisvalue maybe
lowerincasesof multiple damage.
The size of the recoveryrecordmaybe approximatelydetermined
bythe formula<archive size>/256+ <numberof recovery
sectors>*512 bytes.
rv[N] Create recoveryvolumes(.revfiles),whichcanbe later
usedto reconstructmissinganddamagedfilesinavolume
set.Thiscommandmakessense onlyformultivolumearchives
and youneedtospecifythe name of the firstvolume
inthe set as the archive name.For example:
rar rv3 data.part01.rar
Thisfeature maybe useful forbackupsor,for example,
whenyouposteda multivolumearchive toanewsgroup
19. and a part of subscribersdidnotreceive someof the files.
Repostingrecoveryvolumesinsteadof usual volumes
may reduce the total numberof filestorepost.
Each recoveryvolume isable toreconstructone missing
or damagedRARvolume.Forexample,if youhave 30volumes
and 3 recoveryvolumes,youare able toreconstructany
3 missingvolumes.If the numberof .revfilesislessthan
the numberof missingvolumes,reconstructingisimpossible.
The total numberof usual andrecoveryvolumesmustnot
exceed255.
Original RARvolumesmustnotbe modifiedaftercreating
recoveryvolumes.Recoveryalgorithmusesdatastoredboth
inREV filesandinRARvolumestorebuildmissingRARvolumes.
So if youmodifyRARvolumes,forexample,lockthem, after
creatingREV files,recoveryprocesswill fail.
The optional <N> parameterspecifiesanumberof recovery
volumestocreate andmust be lessthanthe total number
of RAR volumesinthe set.Youmay alsoappenda percent
character to thisparameter,insuchcase the numberof
creating.revfileswillbe equal tothispercenttaken
fromthe total numberof RAR volumes.Forexample:
20. rar rv15% data.part01.rar
RAR reconstructsmissinganddamagedvolumeseitherwhen
using'rc' commandor automatically,if itcannotlocate
the nextvolume andfindsthe requirednumberof .revfiles
whenunpacking.
Original copiesof damagedvolumesare renamedto*.bad
before reconstruction.Forexample,volname.part03.rar
will be renamedtovolname.part03.rar.bad.
s[name] Convertarchive toSFX.The archive ismergedwithaSFX module
(usingamodule infile default.sfx orspecifiedinthe switch).
In the Windowsversiondefault.sfx shouldbe placedinthe
same directoryasthe rar.exe,inUnix - inthe user's
home directory,in/usr/libor/usr/local/lib.
s- Remove SFXmodule fromthe alreadyexistingSFXarchive.
RAR createsa newarchive withoutSFXmodule,the original
SFXarchive isnot deleted.
t Test archive files.Thiscommandperformsadummyfile
extraction,writingnothingtothe outputstream, inorderto
validate the specifiedfile(s).
21. Examples:
Testarchivesincurrentdirectory:
rar t *
or for Unix:
rar t '*'
User maytest archivesinall sub-directories,starting
withthe currentpath:
rar t -r *
or for Unix:
rar t -r '*'
u Update filesinarchive.Addsfilesnotyetinthe archive
and updatesfilesthathave beenchangedsince theywere packed
intothe archive.
22. v[t,b] Verboselylistthe contentsof archive [technical].
Filesare listedusingthe format:full pathname,file comment,
original andcompressedsize,compressionratio,lastupdate
date and time,attributes,CRC,compressionmethodandminimum
RAR versionrequiredtoextract.
Optional technical informationsuchas"Host OS","Solid"
and "Old"flagsisdisplayed,when't'modifierisused.
"Host OS"showsthe native operatingsystemof RARversion
usedto create an archive."Solid"flagissetif file uses
the compressionstatisticsfromprecedingfiles(see -sswitch).
"Old"flagmeans"Oldfile version"andindicatesif itis
the latestor oldfile version(see -verswitchfordetails).
Modifier'b'forcesRAR to outputonlybare file nameswithout
any additional information.
To listthe contentsof all archive volumes,use anasterisk
('*') inplace of the archive file extensionoruse the '-v'
switch.
Example:
1) listcontentsof system.rararchive (technical mode)
23. and redirectoutputtofile techlist.lst
rar vt system>techlist.lst
2) listcontentsof tutorial.rararchive (bare file namesmode)
rar vb tutorial
x Extract fileswithfullpath.
Example:
rar x -av- -c- dime 10cents.txt
extractspecifiedfiletocurrentpath.AV check andcomment
showare disabled.
Switches(usedinconjunctionwithacommand):
-? Displayhelponcommandsandswitches.The same as whennone
or an illegal commandlineoptionisentered.
24. -- Stop switchesscanning
ThisswitchtellstoRAR thatthere are no more switches
inthe command line.Itcouldbe useful,if eitherarchive
or file name startsfrom'-' character. Without'--'switch
sucha name wouldbe treatedasa switch.
Example:
add all filesfromthe currentdirectorytothe solidarchive
'-StrangeName'
RAR a -s-- -StrangeName
-ac ClearArchive attribute aftercompressionorextraction
(Windowsversiononly).
-ad Appendarchive name todestinationpath.
Thisoptionmaybe useful whenunpackingagroupof archives.
By defaultRARplacesfilesfromall archivesinthe same
directory,butthisswitchcreatesa separate directory
forfilesunpackedfromeacharchive.
25. Example:
rar x -ad *.rar data
RAR will create subdirectoriesbelow 'data'foreveryunpacking
archive.
-ag[format]
Generate archive name usingthe currentdate andtime.
Appendsthe currentdate stringtoan archive name when
creatingan archive.Useful fordailybackups.
Formatof the appendingstringisdefinedbythe optional
"format"parameteror by"YYYYMMDDHHMMSS" if thisparameter
isabsent.The formatstring mayinclude the following
characters:
Y - year
M - month
MMM - monthname as textstring(Jan,Feb,etc.)
W - a weeknumber(aweekstartswithMonday)
A - day of weeknumber(Mondayis1, Sunday - 7)
26. D - dayof month
E - dayof year
H - hours
M - minutes(treatedasminutesif encounteredafterhours)
S - seconds
N - archive number.RARsearchesforalreadyexistingarchive
withgeneratedname andif found,incrementsthe archive
numberuntil generatingaunique name.'N'formatcharacter
isnot supportedwhencreatingvolumes.
Each of formatstringcharacters listedabove representsonly
one character addedto archive name.Forexample,use WWfor
twodigitweeknumberorYYYY to define fourdigityear.
If the firstcharacterin the formatstringis '+', positions
of the date stringand base archive name are exchanged,
so a date will precede anarchive name.
The format stringmaycontainoptional textenclosedin'{'
and '}' characters.This textisinsertedintoarchive name.
All othercharactersare addedto an archive name without
changes.
If you needtoupdate an alreadyexistingarchive,be careful
27. with-agswitch.Dependingonthe formatstringandtime passed
since previous -aguse,generatedandexistingarchive names
may mismatch.Inthiscase RAR will create anew archive
insteadof updatingthe already existing.
Examples:
1) use the defaultYYYYMMDDHHMMSS format
rar a -agbackup
2) use DD-MMM-YY format
rar a -agDD-MMM-YY backup
3) use YYYYMMDDHHMM format,place date before 'backup'
rar a -ag+YYYYMMDDHHMM backup
4) use YYYY-WW-A format,include fieldsdescription
rar a -agYYYY{year}-WW{week}-A{wday} backup
5) use YYYYMMDD and the archive number.Itallowstogenerate
28. unique namesevenwhenYYYYMMDD format maskusedmore than
once inthe same day
rar a -agYYYYMMDD-NN backup
-ai Ignore file attributes.
If thisswitchis usedwhenextracting,RARdoesnotset
general file attributesstoredinarchive toextractedfiles.
Thisswitchpreservesattributesassignedbyoperatingsystem
to a newlycreatedfile.
In Windowsitaffectsarchive,system, hiddenandread-only
attributes.inUnix - user,group,and othersfile permissions.
-ao AddfileswithArchive attributeset
(Windowsversiononly).
Example:
add all diskC: fileswithArchive attributeset
to the 'f:backup'and clearfilesArchive attribute
29. rar a -r -ac -aof:backupc:*.*
-ap Setpath inside archive.Thispathismergedtofile
nameswhenaddingfilestoanarchive and removed
fromfile nameswhenextracting.
For example,if youwishtoaddthe file 'readme.txt'
to the directory'DOCSENG'of archive 'release',
youmay run:
rar a -apDOCSENGrelease readme.txt
or to extract'ENG' to the currentdirectory:
rar x -apDOCSrelease DOCSENG*.*
-as Synchronize archive contents
If thisswitchis usedwhenarchiving, those archivedfiles
whichare not presentinthe listof the currentlyadded
files,will be deletedfromthe archive.Itisconvenientto
use thisswitchincombinationwith -u(update)tosynchronize
contentsof an archive andan archivingdirectory.
30. For example,afterthe command:
rar a -u-as backupsources*.cpp
the archive 'backup.rar' will containonly*.cppfiles
fromdirectory'sources',all otherfileswillbe deleted
fromthe archive.It lookssimilartocreatinga new archive,
butwithone importantexception:if nofilesare modified
since the lastbackup,the operationisperformedmuchfaster
thanthe creationof a newarchive.
-av Put authenticityverification(registeredversionsonly).
RAR will put,ineverynewandupdatedarchive,information
concerningthe creator,lastupdate time andarchive name.
If an archive,containingauthenticityverification,isbeing
modifiedandthisswitchisnotspecified,the authenticity
verificationinformationwillbe removed.
Whenextracting,testing,listingorupdatinganarchive with
the '-av' switch,RARwill performintegrityvalidationand
displaythe message:
31. Verifyingauthenticityinformation...
In the case of successful authenticityverification,
message 'Ok',creatorname andlast update informationwillbe
displayed.Inthe case of authenticityverificationfailure,
message 'FAILED'will be displayed.
RAR authenticityverificationcanbe forgedanddoesnot
provide the same levelof securityasmoderndigital signature
schemesbasedonpublickeyinfrastructure.We recommend
to use thisRAR feature asinformationalonly,like aspecial
archive comment.Avoiditinsituations,whenaccurate
informationaboutarchive creatorisimportant.
In orderto enable the authenticityverificationfeature,
the program mustbe registered.Please contactyourlocal
distributionsite orthe world-wide distributioncenter.
-av- Disable authenticityverificationcheckingoradding.
-cfg- Ignore configurationfile andRARenvironmentvariable.
32. -cl Convertfile namestolowercase.
-cu Convertfile namestouppercase.
-c- Disable commentsshow.
-df Delete filesafterarchiving
Move filestoarchive.Thisswitchincombinationwith
the command"A" performsthe same actionas the command"M".
-dh Opensharedfiles
Allowstoprocessfilesopenedbyotherapplications
forwriting.
Thisswitchhelpsif anapplication allowedreadaccess
to file,butif all typesof file accessare prohibited,
the file openoperationwill still fail.
Thisoptioncouldbe dangerous,because itallows
33. to archive a file,whichatthe same time ismodified
byanotherapplication,souse itcarefully.
-dr Delete filestoRecycle Bin
Delete filesafterarchivingandplace themtoRecycle Bin.
AvailableinWindowsversiononly.
-ds Do not sortfileswhile addingtoa solidarchive.
-dw Wipe filesafterarchiving
Delete filesafterarchiving.Beforedeletingfile data
are overwrittenbyzerobytestopreventrecoveryof
deletedfiles.
-ed Do not add emptydirectories
Thisswitchindicatesthatdirectoryrecordsare notto be
storedinthe createdarchive.Whenextractingsucharchives,
RAR createsnon-emptydirectoriesbasingonpathsof files
34. containedinthem.Informationaboutemptydirectoriesis
lost.All attributesof non-emptydirectoriesexceptaname
(accessrights,streams,etc.) will be lostaswell,souse
thisswitchonlyif youdo notneedto preserve suchinformation.
If -edis usedwith'm' commandor -df switch,RARwill not
remove emptydirectories.
-ee Do not processextendedattributes
Disablessavingandrestoringextendedfile attributes.
OnlyforOS/2 versions.
-en Do not add "endof archive"block
By default,RARaddsan "endof archive"blockto the endof
a newor updatedarchive.Itallowstoskipexternal datalike
digital signaturessafely,butinsome special casesitmaybe
useful todisable thisfeature.Forexample,if anarchive
istransferredbetweentwosystemsviaanunreliablelinkand
at the same time a senderaddsnew filestoit,itmay be
importanttobe sure that the alreadyreceivedfile partwill
notbe modifiedonthe otherendbetweentransfersessions.
35. Thisswitchcannotbe usedwithvolumes,because the end
of archive blockcontainsinformationimportantforcorrect
volume processing.
-ep Exclude pathsfromnames.Thisswitchenablesfilestobe added
to an archive withoutincludingthe pathinformation.This
could,of course,resultinmultiplefilesexistinginthe
archive withthe same name.
-ep1 Exclude base dirfrom names.Donot store the path enteredin
the commandline.
Example:
all filesand directoriesfromthe directorytmpwill be added
to the archive 'test',but the path inarchivednameswill not
include 'tmp'
rar a -ep1-r testtmp*
Thisis equivalenttothe commands:
36. cd tmp
rar a -r ..test
cd ..
-ep2 Expandpaths to full.Store full file paths(exceptadrive
letterandleadingpathseparator) whenarchiving.
-ep3 Expandpaths to full includingthe drive letter.
Windowsversiononly.
Thisswitchstoresfull file pathsincludingthe drive
letterif usedwhenarchiving.Driveseparators(colons)
are replacedbyunderscore characters.
If you use -ep3whenextracting,itwill change
underscoresbacktocolonsand create unpackedfiles
intheiroriginal directoriesanddisks.If the user
alsospecifiedadestinationpath,itwill be ignored.
It alsoconvertsUNC pathsfrom servershare to
__servershare whenarchivingandrestoresthemto
the original state whenextracting.
37. Thisswitchcan helptobackup several diskstothe same
archive.Forexample,youmayrun:
rar a -ep3-r backup.rarc: d: e:
to create backupand:
rar x -ep3backup.rar
to restore it.
But be cautiousand use -ep3onlyif youare sure that
extractingarchive doesnotcontainanymaliciousfiles.
In otherwords,use itif you have createdan archive yourself
or completelytrustitsauthor.Thisswitchallowstooverwrite
any file inanylocationonyourcomputerincludingimportant
systemfilesandshouldnormallybe usedonlyforthe purpose
of backup andrestore.
-e[+]<attr>
Specifiesfileexcludeorinclude attributesmask.
<attr> isa numberinthe decimal,octal (withleading'0')
or hex (withleading'0x') format.
38. By default,without'+' signbefore <attr>,thisswitch
definesthe excludemask.Soif resultof bitwise ANDbetween
<attr> andfile attributesisnonzero,file wouldnotbe
processed.
If '+' signis present,itspecifiesthe include mask.
Onlythose fileswhichhave atleastone attribute specified
inthe mask will be processed.
In Windowsversionisalsopossibletouse symbolsD,S,H,
A andR insteadof a digital masktodenote directories
and fileswithsystem,hidden,archive andread-onlyattributes.
The order inwhich the attributesare givenisnotsignificant.
Unix versionsupportsDand V symbolstodefine directory
and device attributes.
It isallowedtospecifyboth -e<attr>and -e+<attr>
inthe same commandline.
Examples:
1) archive onlydirectorynameswithouttheircontents
rar a -r -e+ddirs
39. 2) do notcompresssystemandhiddenfiles:
rar a -eshfiles
3) do notextract read-onlyfiles:
rar x -erfiles
-f Freshenfiles.Maybe usedwitharchive extractionorcreation.
The commandstring "a -f"isequivalenttothe command'f', you
couldalsouse the switch'-f' withthe commands'm' or 'mf'. If
the switch'-f' isusedwiththe commands'x' or 'e', thenonly
oldfileswouldbe replacedwithnew versionsextractedfromthe
archive.
-hp[p] Encryptboth file dataandheaders.
Thisswitchissimilarto -p[p],butswitch -pencrypts
onlyfile dataandleavesotherinformationlikefile names
visible.Thisswitchencryptsall sensitivearchive areas
includingfile data,file names,sizes,attributes,comments
and otherblocks,soitprovidesahighersecuritylevel.
40. Withouta passworditisimpossible toview eventhe listof
filesinarchive encryptedwith-hp.
Example:
rar a -hpfGzq5yKwsecretreport.txt
will addthe file report.txttothe encryptedarchive
secret.rarusingthe password'fGzq5yKw'
-id[c,d,p,q]
Disable messages.
Switch-idcdisablesthe copyrightstring.
Switch-idddisables"Done"stringatthe endof operation.
Switch-idpdisablesthe percentageindicator.
Switch-idqturnsonthe quietmode,soonlyerrormessages
and questionsare displayed.
It isallowedtouse several modifiersatonce,
so switch -idcdpiscorrect.
41. -ieml[.][addr]
Sendarchive byemail.Windowsversiononly.
Attachan archive createdor updatedbythe add command
to email message.Youneedtohave aMAPI compliantemail
clienttouse thisswitch(mostmodernemail programs
supportMAPIinterface).
You mayentera destinationemailaddressdirectly
inthe switchor leave itblank.Inthe lattercase you
will be askedforitby youremail program.It ispossible
to specifyseveraladdressesseparatedbycommasor semicolons.
If you appenda dotcharacter to -ieml,anarchive will be
deletedafteritwassuccessfullyattachedtoanemail.
If the switchisusedwhencreatingamultivolume archive,
everyvolume isattachedtoa separate email message.
-ierr Sendall messagestostderr.
-ilog[name]
42. Log errorsto file (registeredversiononly).
Write error messagestorar.logfile.If optional 'name'
parameterisnotspecified,the log file iscreated
usingthe followingdefaults:
Unix: .rarlogfile inthe user'shome directory;
Windows:rar.logfile in%APPDATA%WinRARdirectory.
If 'name' parameterincludesafile name withoutpath,
RAR will create the logfile indefaultdirectoryfrom
the listabove usingthe specifiedname.Include bothpath
and name to 'name'parameterif youwishto change
the locationof logfile.
Example:
rar a -ilogc:logbackup.logbackupd:docs
will create c:logbackup.loglogfile incase of errors.
-inul Disable all messages.
43. -ioff Turn PC off aftercompletinganoperation.The hardware must
supportthe poweroff feature.Windowsversiononly.
-isnd Enable sound.
-k Lock archive.Anycommandwhichintendstochange the archive
will be ignored.
-kb Keepbrokenextractedfiles.
RAR,by default,deletesfileswithCRCerrorsafter
extraction.The switch -kbspecifiesthatfileswith
CRC errorsshouldnotbe deleted.
-m<n> Setcompressionmethod:
-m0 store do not compressfile whenadding toarchive
-m1 fastest use fastestmethod(lesscompressive)
-m2 fast use fastcompressionmethod
-m3 normal use normal (default) compressionmethod
-m4 good use goodcompressionmethod(more
44. compressive,butslower)
-m5 best use bestcompressionmethod(slightlymore
compressive,butslowest)
If thisswitchis notspecified,RARuses -m3method
(normal compression).
By default,RARusesonlythe general compression
algorithmin -m1and -m2 methods,advancedalgorithms
like audioandtrue colorprocessingare enabled
onlyin -m3..-m5modes,the advancedtextcompression
isactivatedonlyin -m4..-m5.Thisdefaultcanbe
overriddenusing -mcswitch.
-mc<par>
Setadvancedcompressionparameters.
Thisswitchisintendedmainlyforbenchmarkingand
experiments.Inthe real environmentitisusuallybetter
to allowRARto selectoptimal parametersautomatically.
Please note thatimproperuse of thisswitchmaylead
to veryseriousperformance andcompressionloss,souse
itonlyif you clearlyunderstandwhatyoudo.
45. It has the followingsyntax:
-mc[param1][:param2][module][+or-]
where <module>isthe one characterfielddenotingapart
of the compressionalgorithm,whichhastobe configured.
It mayhave the followingvalues:
A - audiocompression;
C - true color(RGB) data compression;
D - deltacompression;
E - 32-bitx86 executablescompression;
I - 64-bit Intel Itaniumexecutablescompression;
T - textcompression.
'+' signat the endof switchappliesthe selectedalgorithm
module toall processeddata,'-' disablesthe module atall.
If no signis specified,RARwillchoose modulesautomatically,
basedondata and the current compressionmethod.
Switch-mc- disablesall optional modulesandallowsonly
the general compressionalgorithm.
<Param1> and<Param2> are module dependentparameters
46. describedbelow.
Audiocompression,deltacompression:
<Param1> isa numberof byte channels(canbe 1 - 31).
RAR splitsmultibyte channelstobytes,forexample,
two16-bit audiochannelsare consideredbyRARasfour
channelsone byte each.
<Param2> isignored.
32-bitx86 Intel executablescompression,
64-bitIntel Itaniumexecutablescompression,
true color (RGB) data compression:
<Param1> and<Param2> are ignored.
Textcompression:
<Param1> isthe order of PPMalgorithm(canbe 2 - 63).
Usuallya highervalue slightlyincreasesthe compressionratio
of redundantdata,but onlyif enoughmemoryisavailable
to PPM. Incase of lack of memorythe result maybe negative.
47. Higherordervaluesdecrease bothcompressionanddecompression
speed.
<Param2> ismemoryinmegabytesallocatedforPPM(1-128).
Highervaluesmayincrease the compressionratio,butnote
that PPMusesthe equal memorysize bothtocompressand
decompress,soif youallocate toomuchmemorywhencreating
an archive,otherpeople mayhave problemswhendecompressing
iton a computerwithlessmemoryinstalled.Decompression
will be still possible usingvirtualmemory,butitmay
become veryslow.
Examples:
1) switch -mc1a+ forcesuse of 8-bitmonoaudiocompression
forall data.
2) switch -mc10:40t+ forcesuse of textcompression
algorithmforall data,setsthe compressionorderto10
and allocates40 MB memory.
3) switch -mc12t setsthe textcompressionorderto12,
whenthe textcompressionisused,butleavestoRARto
decide whentouse it.
48. 4) switches -mct- -mcd- disabletextanddeltacompression.
-md<n> Selectdictionarysize <n>inKB. Must be 64, 128, 256, 512,
1024, 2048 or 4096 or a letter'a', 'b', 'c', 'd', 'e', 'f', 'g'
respectively.
The slidingdictionaryisaspecial memoryareausedbythe
compressionalgorithm.If the size of the file beingcompressed
(orthe total filessize inthe case of a solidarchive) is
greaterthanthe dictionarysize,thenincreasingthe dictionary
size will generallyincreasecompressionratio,decrease packing
speedandincrease memoryrequirements.
RAR can reduce the dictionarysize if itissignificantly
largerthan the size of the source data. It helpstoreduce
memoryrequirementswithoutdecreasingcompression.
Defaultslidingdictionarysize is4096 KB.
Example:
RAR a -s-mddsources*.asm
or
49. RAR a -s-md512 sources*.asm
Will create a solidarchive usinga512 KB dictionary.
-ms[list]
Specifyfiletypestostore.
Specifyfiletypes,whichwillbe storedwithoutcompression.
Thisswitchmay be usedto store alreadycompressedfiles,
whichhelpstoincrease archivingspeedwithoutnoticeable
lossinthe compressionratio.
Optional <list>parameterdefinesthe listof file extensions
separatedbysemicolons.Forexample, -msrar;zip;jpgwill
force RAR to store withoutcompressionall RARandZIP
archivesandJPG images.It isalsoallowedtospecifywildcard
file masksinthe list,so -ms*.rar;*.zip;*.jpgwill worktoo.
If <list> isnot specified, -msswitchwill use the default
setof extensions,whichincludesthe followingfiletypes:
7z, ace, arj,bz2, cab, gz, jpeg,jpg,lha,lzh,mp3,
rar, taz, tgz,z, zip
50. -mt<threads>
Setthe numberof threads.Available inWindowsversiononly.
<threads>parametercan take valuesfrom0 to16.
It definesthe recommendednumberof active threads
forcompressionalgorithm.If itisgreaterthan0,
RAR will use the multithreadedversionof compression
algorithmprovidinghigherspeedonmultiprocessor
architectures.Real numberof active threadscandiffer
fromthe specified.
If <threads> iszero,RAR will use the single threaded
compressionalgorithm.
Change of <threads> parameterslightlyaffectsthe compression
ratio,so archivescreatedwithdifferent -mtswitches
will notbe exactlythe same evenif all othercompression
settingsare equal.
If -mt switchisnot specified,RARwilltryto detect
the numberof available processorsandselectthe optimal
numberof threadsautomatically.
51. -n<f> Include onlythe specifiedfile <f>.Wildcardsmaybe used
bothin the name and file partsof file mask.Youmay specify
the switch'-n' several times.
Thisswitchdoesnotreplace usual file masks,whichstill
needtobe enteredinthe commandline.Itisan additional
filterlimitingprocessedfilesonlytothose matching
the include maskspecifiedin -nswitch.Itcanhelpto
reduce the commandline lengthsometimes.
For example,if youneedtocompressall *.txtand*.lst
filesindirectoriesProjectandInfo,youcan enter:
rar a -r textProject*.txtProject*.lstInfo*.txtInfo*.lst
or usingthe switch -n:
rar a -r -n*.txt-n*.lsttextProjectInfo
-n@<lf>Include fileslistedinthe specifiedlistfile.
Similarto-n<f>switch,butreads include masksfrom
the listfile.If youuse -n@withoutthe listfile name
parameter,itwill readfile namesfromstdin.
52. Example:
rar a -r -n@inclist.txttextProjectInfo
-oc Set NTFSCompressedattribute.Windowsversiononly.
Thisswitchallowstorestore NTFSCompressedattribute
whenextractingfiles.RARsaves Compressedfileattributes
whencreatinganarchive,butdoesnot restore themunless
-oc switchisspecified.
-ol Save symboliclinksasthe linkinsteadof the file.
Unix versiononly.
-or Rename extractedfilesautomaticallyif file withthe same name
alreadyexists.Renamedfile will getthe name like
'filename(N).txt',where 'filename.txt'isthe original file
name and 'N' isa numberstartingfrom1 and incrementing
if file exists.
53. -os Save NTFSstreams.Windowsversiononly.
Thisswitchhas meaningonlyforNTFSfile systemandallows
to save alternative datastreamsassociatedwithafile.
It isespeciallyimportantinWindows2000,XP and newer,
whichuse streamsto keepsome filedependentinformation
like file descriptions.If youuse RARto backupyour
NTFSdisks,itisrecommendedtospecifythisswitch.
-ow Use thisswitchwhenarchivingtosave file security
informationandwhenextractingtorestore it.
Unix RAR versionsavesfileownerandgroupwhenusing
thisswitch.
Windowsversionstoresowner,group,file permissionsand
auditinformation,butonlyif youhave necessaryprivileges
to readthem.Note that onlyNTFSfile systemsupports
file basedsecurityunderWindows.
-o[+|-] Setthe overwrite mode. Canbe usedbothwhenextracting
and updatingarchivedfiles.Followingmodesare available:
54. -o Askbefore overwrite
(defaultforextractingfiles);
-o+ Overwrite all
(defaultforupdatingarchivedfiles);
-o- Skipexistingfiles.
-p[p] Encrypt fileswiththe string<p>as passwordwhile archiving.
The passwordiscase-sensitive.If youomitthe passwordonthe
commandline,youwill be promptedwithmessage"Enterpassword".
Example:
rar a -pmyhoneysecret1*.txt
add files*.txtandencryptthemwithpassword"myhoney".
-p- Do notquerypassword
-r Recurse subdirectories.Maybe usedwithcommands:
a, u, f,m, x,e,t, p, v,l, c, cf and s.
55. Whenusedwiththe commands'a', 'u', 'f', 'm' will process
filesinall sub-directoriesaswell asthe currentworking
directory.
Whenusedwiththe commandsx,e,t, p, v,l, c, cf or s will
processall archivesinsub-directoriesaswell asthe current
workingdirectory.
-r- Disable recursion.
Evenwithout-rswitchRAR can enable the recursion
automaticallyinsome situations.Switch -r- prohibitsit.
If you specifyadirectoryname whenarchivingandif such
name doesnotinclude wildcards,bydefaultRARadds
the directorycontentsevenif switch -risnotspecified.
AlsoRARautomaticallyenablesthe recursionif diskroot
withoutwildcardsisspecifiedasafile mask.Switch -r-
disablessuchbehavior.
For example:
rar a -r- arc dirname
56. commandwill add onlythe empty'dirname'directoryandignore
itscontents.Followingcommand:
rar a -r- arc c:
will compresscontentsof rootc: directoryonlyand
will notrecurse intosubdirectories.
-r0 Similarto-r,but whenusedwiththe commands'a', 'u', 'f',
'm' will recurse subdirectoriesonlyforthose names,which
include wildcardcharacters'*' and'?'
-ri<p>[:<s>]
Setpriorityand sleeptime.Available onlyinRARforWindows.
ThisswitchregulatessystemloadbyRARinmultitasking
environment.Possible taskpriority<p>valuesare 0 - 15.
If <p> is0, RAR usesthe defaulttaskpriority.
<p> equal to 1 setsthe lowestpossible priority,
15 - the highestpossible.
Sleeptime <s>isa value from0 to 1000 (milliseconds).
57. Thisis a periodof time thatRAR givesbackto the system
aftereveryreador write operationwhile compressing
or extracting.Non-zero<s>may be useful if youneedtoreduce
systemloadevenmore thancan be achievedwith<p>parameter.
Example:
execute RARwithdefaultpriorityand10 ms sleeptime:
rar a -ri0:10 backup *.*
-rr[N] Adda data recoveryrecord.Thisswitchisusedwhencreating
or modifyinganarchive toadda data recoveryrecordto
the archive.See the 'rr[N]'commanddescriptionfordetails.
-rv[N] Create recoveryvolumes.Thisswitchisusedwhencreating
a multivolume archive togenerate recoveryvolumes.
See the 'rv[N]'commanddescriptionfordetails.
-s Create solidarchive.A solidarchive isanarchive packedby
a special compressionmethod,whichtreatsseveral orall
files,withinthe archive,asone continuousdatastream.
58. Solidarchivingsignificantlyincreasescompression,when
addinga large numberof small,similarfiles.Butitalso
has a fewimportantdisadvantages:slowerupdatingof existing
solidarchives,sloweraccesstoindividual files,lower
damage resistance.
Usuallyfilesinasolidarchive are sortedbyextension.
But itis possible todisablesortingwith -dsswitchorset
an alternative file orderusingaspecial file,rarfiles.lst.
Example:
create solidarchive sources.rarwith512 KB dictionary,
recursingall directories,startingwiththe currentdirectory.
Addonly.asmfiles:
rar a -s-md512 sources.rar*.asm -r
-s<N> Create solidgroupsusingfilecount
Similarto-s,but resetssolidstatisticsaftercompressing
<N> files.Usuallydecreasescompression,butalso
decreaseslossesincase of solidarchive damages.
59. -sc<charset>[objects]
Specifythe charactersetfor listfilesandarchive
commentfiles.
'Charset'parameterismandatoryand can have one
of the followingvalues:
U - Unicode;
A - ANSI(Windows) encoding.Windowsversiononly;
O - OEM (DOS) encoding.Windowsversiononly.
FilesinUnicode formatmusthave FFFEor FEFF Unicode
character inthe beginning,otherwise RARwill ignore
thisswitchandprocessthe file asASCIItext.
'Objects'parameterisoptional andcan have one of
the followingvalues:
L - listfiles;
C - commentfiles.
It isallowedtospecifymore thanone object,forexample,
-scolc.If 'objects'parameterismissing,'charset'isapplied
60. to all objects.
Thisswitchallowstospecifythe charactersetfor files
in-z[file]switch,listfilesandcommentfileswrittenby
"cw" command.
Examples:
1) rar a -scol data @list
Readnamescontainedin'list'usingOEMencoding.
2) rar c -scuc -zcomment.txtdata
Readcomment.txtasUnicode file.
3) rar cw -scucdata comment.txt
Write comment.txtasUnicode file.
-se Create solidgroupsusingextension
Similarto-s,but resetssolidstatisticsif file extension
ischanged.Usuallydecreasescompression,butalso
61. decreaseslossesfromsolidarchive damages.
-sfx[name]
Create SFXarchives.If thisswitchisusedwhencreatinganew
archive,aSelf-Extractingarchive (usingamodule infile
default.sfx orspecifiedinthe switch)wouldbe created.
In the Windowsversiondefault.sfx shouldbe placedinthe
same directoryasthe rar.exe,inUnix - inthe user's
home directory,in/usr/libor/usr/local/lib.
Example:
rar a -sfxwincon.sfx myinst
create SelF-eXtracting(SFX)archive usingwincon.sfx
SFX-module.
-si[name]
Readdata from stdin(standardinput),whencreating
an archive.Optional 'name'parameterallowstospecify
a file name of compressedstdindatainthe created
archive.If thisparameterismissing,the name willbe
setto 'stdin'.Thisswitchcannot be usedwith -v.
62. Example:
type Tree.Far| rar a -siTree.Fartree.rar
will compress'type Tree.Far'outputas'Tree.Far'file.
-sl<size>
Processonlythose files,whichsize islessthan
specifiedin<size>parameterof thisswitch.
Parameter<size>mustbe specifiedinbytes.
-sm<size>
Processonlythose files,whichsize ismore than
specifiedin<size>parameterof thisswitch.
Parameter<size>mustbe specifiedinbytes.
-sv Create independentsolidvolumes
By defaultRARtriestoresetsolidstatisticsassoon
as possible whenstartinganewvolume,butonly
if enoughdatawas packedaftera previousreset
63. (at leasta fewmegabytes).
ThisswitchforcesRARto ignore packeddata size andattempt
to resetstatisticsforvolumesof anysize.Itdecreases
compression,butincreaseschancestoextracta part of data
if one of several solidvolumesinavolume setwaslost
or damaged.
Note thatsometimesRARcannotresetstatisticseven
usingthisswitch.Forexample,itcannotbe done when
compressingone large filesplitbetweenseveral volumes.
RAR isable to resetsolidstatisticsonlybetweenseparate
files,butnotinside of singlefile.
Ignoredif usedwhencreatinganon-volumearchive.
-sv- Create dependentsolidvolumes
Disablestoresetsolidstatisticsbetweenvolumes.
It slightlyincreasescompression,butsignificantlyreduces
chancesto extracta part of data if one of several solid
volumesinavolume setwaslostor damaged.
64. Ignoredif usedwhencreatinganon-volumearchive.
-s- Disable solidarchiving
-t Testfilesafterarchiving.Thisswitchisespecially
useful incombinationwiththe move command,sofileswillbe
deletedonlyif the archive hadbeensuccessfullytested.
-ta<date>
Processonlyfilesmodifiedafterthe specifieddate.
Formatof the date string isYYYYMMDDHHMMSS.
It isallowedtoinsertseparatorslike '-'or':' to
the date stringand omittrailingfields.Forexample,
the followingswitchiscorrect: -ta2001-11-20
Internallyitwillbe expandedto -ta20011120000000
and treatedas"filesmodifiedafter0hour 0 minutes
0 secondsof 20 November2001".
-tb<date>
Processonlyfilesmodifiedbefore the specifieddate.
65. Formatof the switchisthe same as -ta<date>.
-tk Keeporiginal archive date.PreventsRARfrommodifyingthe
archive date whenchanginganarchive.
-tl Setarchive time tonewestfile.ForcesRARtoset the date of a
changedarchive tothe date of the newest fileinthe archive.
-tn<time>
Processfilesnewerthanthe specifiedtimeperiod.Format
of the time stringis:
[<ndays>d][<nhours>h][<nminutes>m][<nseconds>s]
For example,use switch -tn15dtoprocessfilesnewer
than15 daysand -tn2h30m to processfilesnewerthan
2 hours30 minutes.
-to<time>
Processfilesolderthanthe specifiedtime period.Format
of the switchisthe same as -tn<time>.
66. -ts<m,c,a>[N]
Save or restore file time (modification,creation,access).
Switch-tsminstructsRARto save file modificationtime,
-tsc- creationtime andtsa - last accesstime.Optional
parameterafterthe switchisthe numberbetween0and4
controllingthe filetime precision.Value'1' enables
1 secondprecision,2- 0.0065536 sec,3 - 0.0000256 secand
4 or '+' enablesthe maximumNTFStime precision,whichis
equal to0.0000001 sec.Value '0' or '-' meansthatcreation
and accesstime are not savedand low (twoseconds) precision
isusedfor modificationtime.Higherprecisionmodesadd
more data to archive,upto 19 additional bytesperfile
incase of -tsm4 -tsa4 -tsc4 combination.If noprecision
isspecified,RARuses'4' (high) value.
DefaultRARmode is -tsm4 -tsc0 -tsa0,so modificationtime
isstoredwiththe highprecisionandothertimesare ignored.
It isnecessarytospecify -tscand-tsa switchestoset
creationandaccess time whenunpackingfiles(precision
isirrelevant,butmustnotbe 0). By defaultRARsets
onlythe modificationtime,evenif archive contains
67. creationandlast accesstime.Settingthe modification
time tounpackedfilesmaybe alsodisabledwith -tsm-.
It ispossible toomitthe time type letterif youneed
to applythe switchto all three times.Forexample,
-tsm4-tsa4 -tsc4 can be replacedby -ts4, -ts+ or -ts.
Use -ts- to save onlythe lowprecisionmodificationtime
or to ignore all three file timesonunpacking.
Whencreatingan archive,RARautomaticallyreduces
the precisionif highmode isnotsupportedbythe file
system.Itisnot more than 2 secondsonFATand 1 second
inUnix.NTFStime precisionis0.0000001 second.
Operatingsystemslimitwhichtimecanbe seton unpacking.
Windowsallowstosetall three times,Unix - modification
and lastaccess, but notcreation.
Examples:
1) rar a -tsbackup
Store all file timeswiththe highestpossibleprecision.
2) rar x -tsa backup
68. Restore modificationandlastaccesstime.Switch -tsm
isnot required,because RARusesitbydefault.
3) rar a -tsm1 -tsc1 backup
Store lowprecisionmodificationandcreationtime.
Without-tsm1RAR wouldsave the highprecisionmodification
time.
-u Update files.Maybe usedwitharchive extractionorcreation.
The commandstring "a -u"is equivalenttothe command'u',you
couldalsouse the switch'-u' withthe commands'm' or 'mf'.If
the switch'-u' isusedwiththe commands'x' or 'e', thenfiles
notpresentonthe diskandfilesnewerthantheircopiesonthe
diskwouldextractedfromthe archive.
-v Create volumeswithsize autodetectionorlistall volumes
Thisswitchmay be usedwhencreatingorlistingvolumes.
In the firstcase it enablesvolumesize autodetection,
so newvolumeswill use all availablespace onthe destination
69. media.Itisconvenientwhencreatingvolumesonremovable
disks.Youmay readmore about volumesin -v<size>description.
In the secondcase,whenthisswitchisusedtogetherwith
'V' or 'L' command,itforcesRAR to listcontentsof all
volumesstartingfromthatspecifiedinthe commandline.
WithoutthisswitchRARdisplayscontentsof onlyone single
specifiedvolume.
-v<size>[k|b|f|m|M|g|G]
Create volumeswithsize=<size>*1000 [*1024 | *1].
By defaultthisswitchuses<size>asthousands(1000) of bytes
(not1024 x bytes).Youmayalsoenterthe size inkilobytes
usingthe symbol 'k',in bytesusingthe symbol 'b',
megabytes - 'm',millionsof bytes- 'M', gigabytes - 'g',
billions(milliards)of bytes - 'G' or selectone of several
predefinedvaluesusingthe symbol 'f'followingthe numerical
value.Predefinedvaluescanbe 360, 720, 1200, 1440 or 2880
and replacedwithcorrespondingfloppydisksize.
If the size isomitted,autodetectionwill be used.
You mayspecifyseveral -vswitchestosetdifferentsizes
fordifferentvolumes.Forexample:
70. rar a -v100k -v200k -v300k arcname
sets100 KB size for firstvolume,200 KBfor second
and 300 KB for all followingvolumes.
If volumesare createdonremovable media,thenafter
the creationof the first volume,the userwillbe prompted
with:
Create nextvolume:Yes/No/All
At thismomentintime,youshouldchange the disks.Answering
'A' will cause all volumestobe createdwithoutapause.
By defaultRARvolumeshave nameslike 'volname.partNNN.rar',
where NNN isthe volume number.Using -vnswitchitis
possible toswitchtoanother,extensionbasednamingscheme,
where the firstvolume file inamulti-volume sethas
the extension.rar,followingvolumesare numberedfrom.r00
to .r99.
Whenextractingortestinga multi-volume archive youmustuse
onlythe firstvolume name.If there isnonext volume
on the drive andthe diskisremovable,the userwill be
71. promptedwith:
Insertdiskwith<nextvolume name>
Insertthe diskwiththe correct volume andpressanykey.
If while extracting,the nextvolumeisnotfoundandvolumes
are placedonthe non-removable disk,RARwillabortwith
the error message:
Cannotfind<volume name>
Archive volumesmaynotbe modified.The commands'd','f','u',
's' cannot be usedwithMulti-volume sets.The command'a'may
be usedonlyforthe creationof a new multi-volumesequence.
It ispossible,althoughunlikely,thatthe file size,of afile
ina multi-volume set,couldbe greaterthanitsuncompressed
size.Thisisdue to the fact that 'storing'(nocompressionif
size increases) cannotbe enabledformulti-volume sets.
Archive volumesmaybe Self-Extracting(SFX).Suchanarchive
shouldbe createdusingboththe '-v' and'-sfx'switches.
Example:
72. create archive involumesof fixedsize:
rar a -s-v1440 floparch.rar*.*
will create solidvolumesof size 1440000 bytes.
-vd Erase diskcontentsbefore creatingvolume
All filesanddirectoriesonthe targetdiskwill be erased
when'-vd'isused. The switchappliesonlytoremovable
media,the harddiskcannotbe erasedusingthisswitch.
-ver[n] File versioncontrol
ForcesRAR to keeppreviousfileversionswhenupdating
filesinthe alreadyexistingarchive.Oldversionsare
renamedto'filename;n',where 'n'isthe versionnumber.
By default,whenunpackinganarchive withoutthe switch
-ver,RARextractsonlythe lastaddedfile version,the name
of whichdoesnot include anumericsuffix.Butif youspecify
a file name exactly,includingaversion,itwill be also
73. unpacked.Forexample,'rarx arcname' will unpackonly
lastversions,when'rarx arcname file.txt;5'will unpack
'file.txt;5',if itispresentinthe archive.
If you specify -verswitchwithoutaparameterwhenunpacking,
RAR will extractall versionsof all filesthatmatch
the enteredfile mask.Inthiscase aversionnumberis
notremovedfromunpackedfile names.Youmayalsoextract
a concrete file versionspecifyingitsnumberas -verparameter.
It will tell RARtounpackonlythisversionandremove
a versionnumberfromfile names.Forexample,
'rar x -ver5 arcname'will unpackonly5th file versions.
If you specify'n'parameterwhenarchiving,itwill limit
the maximumnumberof file versionsstored inthe archive.
Oldfile versionsexceedingthisthresholdwillbe removed.
-vn Use the oldstyle volume namingscheme
By defaultRARvolumeshave nameslike 'volname.partNNN.rar',
where NNN isthe volume number.Using-vnswitchitis
possible toswitchtoanother,extensionbasednamingscheme,
where the firstvolume file inamulti-volume sethas
the extension.rar,followingvolumesare numberedfrom.r00
74. to .r99.
-vp Pause before eachvolume
By defaultRARasksforconfirmationbefore creating
or unpackingnextvolume onlyforremovabledisks.
ThisswitchforcesRARto ask such confirmationalways.
It can be useful if diskspace islimitedandyouwish
to copyeach volume toanothermediaimmediatelyafter
creation.
-w<p> Assignworkdirectoryas<p>. Thisswitchmay be usedto assign
the directoryfortemporaryfiles.
-x<f> Exclude the specified<f>file ordirectory.Wildcardscanbe
usedinboththe name andpath parts of file mask.Youcan
specifythe switch'-x'several timestodefine several
exclusionmasksinthe same commandline.
If mask containswildcards,itappliestofilesincurrent
directoryanditssubdirectories.Itisnotrecursive without
wildcards,so"filename"maskwill exclude'filename'file
75. onlyincurrentdirectorywhenarchivingorinroot archive
directorywhenextracting.
Use "*filename"syntax toexclude "filename"recursively
inall directories.
If you knowthe exactpath to file,youcanuse "pathfilename"
syntax toexclude onlythiscopyof "filename".If youuse
-xpathfilenamesyntax whenunpackinganarchive,"path"mustbe
the path inside of archive,notthe file pathonthe diskafter
unpacking.
By default,maskscontainingwildcardsare appliedonlytofiles.
If you needamask withwildcardstoexclude several directories,
use the special syntax fordirectoryexclusionmasks.
Suchmasks musthave the trailingpathseparatorcharacter
('' forWindowsand'/' forUnix).For example,"*tmp*"mask
will exclude all directoriesmatching"*tmp*"and"*tmp"will
exclude all 'tmp'directories.Since wildcardsare present,
bothmaskswill be appliedtocontentsof currentdirectory
and all itssubdirectories.
If you wishtoexclude onlyone directory,specifythe exact
name of directoryincludingthe absoluteorrelative path
withoutanywildcards.Inthiscase youdo not needtoappend
76. the path separatorto mask,whichisrequiredonlyfordirectory
exclusionmaskscontainingwildcardstodistinguishthem
fromfile exclusionmasks.
Examples:
1) rar a -r -x*.jpg-x*.avi rawfiles
compressall filesexcept*.jpgand*.avi incurrent directory
and itssubdirectories;
2) rar a -r -x*tempsavecc:*
compressall filesonthe diskc:except'temp'directories
and filesinside of 'temp'directories;
3) rar x -x*.txtdocs
extractall filesexcept*.txtfromdocs.rar.
-x@<lf>Exclude fileslistedinthe specifiedlistfile.If youuse -x@
withoutthe listfile name parameter,itwill readfile names
fromstdin.
77. Example:
rar a -x@exlist.txtarch*.exe
-y Assume Yeson all queries.
-z[f] Readarchive commentfromfile <f>.Use with -scswitch
if youneedto specifythe charactersetfor commenttextfile.
If <f> isnot specified,commentisreadfromstdin.
Limitations
~~~~~~~~~~~
Pathname islimitedto259 symbols.
Maximumarchive commentlengthis62000 bytes.
Commandlimitations:
The commands'd','u','f','c','cf' will notoperate witharchive
volumes.
78. The command'a' cannotbe usedtoupdate an archive volume,onlyto
create a newone.
Exitvalues
~~~~~~~~~~~
RAR exitswithazerocode (0) in case of successful operation.
Non-zeroexitcode indicatessome kindof error:
0 SUCCESS Successful operation.
1 WARNING Nonfatal error(s) occurred.
2 FATALERROR A fatal erroroccurred.
3 CRC ERROR InvalidCRC32control sum.Data is damaged.
4 LOCKEDARCHIVE Attempttomodifyanarchive previouslylocked
by the 'k' command.
5 WRITE ERROR Write to diskerror.
6 OPEN ERROR Openfile error.
79. 7 USER ERROR Command line optionerror.
8 MEMORY ERROR Not enoughmemoryforoperation.
9 CREATE ERROR Create file error
10 NOFILES ERROR Nofilesmatchingthe specifiedmaskwere found.
255 USER BREAK User stoppedthe process
Glossary
~~~~~~~~
Archive Special file containingone ormore filesoptionally
compressedand/orencrypted.
Compression A methodof encodingdatatoreduce it's size.
CRC CyclicRedundancyCheck.Mathematical methodcalculating
special checkinginformationfordatavalidity.
SFX Archive module usedtoextractfilesfromwhenexecuted.
(SelF-eXtractingmodule),usuallyinthe formof a .EXE
80. file.
Solid Anarchive packedusinga special compressionmethodwhich
seesall filesasone continuousdatastream.Particularly
advantageouswhenpackingalarge numberof small files.
Volume Part of a splitarchive.Splittinganarchive tovolumes
allowsstoringthemonseveral removable disks.
Solidvolumesmustbe extractedstartingfromfirst
volume insequence.
Copyrights
(c) 1993-2011 AlexanderRoshal