-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrar.txt
2463 lines (1669 loc) · 97.2 KB
/
rar.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
User's Manual
~~~~~~~~~~~~~
RAR 5.50 console version
~~~~~~~~~~~~~~~~~~~~~~~~
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Welcome to the RAR Archiver!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Introduction
~~~~~~~~~~~~
RAR is a console application allowing to manage archive files
in command line mode. RAR provides compression, encryption,
data recovery and many other functions described in this manual.
RAR supports only RAR format archives, which have .rar file name
extension by default. ZIP and other formats are not supported.
Even if you specify .zip extension when creating an archive, it will
still be in RAR format. Windows users may install WinRAR, which supports
more archive types including RAR and ZIP formats.
WinRAR provides both graphical user interface and command line mode.
While console RAR and GUI WinRAR have the similar command line syntax,
some differences exist. So it is recommended to use this rar.txt manual
for console RAR (rar.exe in case of Windows version) and winrar.chm
WinRAR help file for GUI WinRAR (winrar.exe).
Configuration file
~~~~~~~~~~~~~~~~~~
RAR and UnRAR for Unix read configuration information from .rarrc file
in a user's home directory (stored in HOME environment variable)
or in /etc directory.
RAR and UnRAR for Windows read configuration information from rar.ini file,
placed in the same directory as the rar.exe file.
This file may contain the following string:
switches=<any RAR switches separated by spaces>
For example:
switches=-m5 -s
It is also possible to specify separate switch sets for individual
RAR commands using the following syntax:
switches_<command>=<any RAR switches separated by spaces>
For example:
switches_a=-m5 -s
switches_x=-o+
Environment variable
~~~~~~~~~~~~~~~~~~~~
Default parameters may be added to the RAR command line by establishing
an environment variable "RAR".
For instance, in Unix following lines may be added to your profile:
RAR='-s -md1024'
export RAR
RAR will use this string as default parameters in the command line and
will create "solid" archives with 1024 KB sliding dictionary size.
RAR handles options with priority as following:
command line switches highest priority
switches in the RAR variable lower priority
switches saved in configuration file lowest priority
Log file
~~~~~~~~
If the switch -ilog is specified in the command line or configuration
file, RAR will write informational messages, concerning errors
encountered while processing archives, into a log file. Read switch
-ilog description for more details.
The file order list for solid archiving - rarfiles.lst
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rarfiles.lst contains a user-defined file list, which tells RAR
the order in which to add files to a solid archive. It may contain
file names, wildcards and special entry - $default. The default
entry defines the place in order list for files not matched
with other entries in this file. The comment character is ';'.
In Windows this file should be placed in the same directory as RAR
or in %APPDATA%\WinRAR directory, in Unix - to the user's home directory
or in /etc.
Tips to provide improved compression and speed of operation:
- similar files should be grouped together in the archive;
- frequently accessed files should be placed at the beginning.
Normally masks placed nearer to the top of list have a higher priority,
but there is an exception from this rule. If rarfiles.lst contains such
two masks that all files matched by one mask are also matched by another,
that mask which matches a smaller subset of file names will have higher
priority regardless of its position in the list. For example, if you have
*.cpp and f*.cpp masks, f*.cpp has a higher priority, so the position of
'filename.cpp' will be chosen according to 'f*.cpp', not '*.cpp'.
RAR command line syntax
~~~~~~~~~~~~~~~~~~~~~~~
Syntax
RAR <command> [ -<switches> ] <archive> [ <@listfiles...> ]
[ <files...> ] [ <path_to_extract\> ]
Description
Command line options (commands and switches) provide control of
creating and managing archives with RAR. The command is a string (or a
single letter) which commands RAR to perform a corresponding action.
Switches are designed to modify the way RAR performs the action. Other
parameters are archive name and files to be archived into or extracted
from the archive.
Listfiles are plain text files that contain names of files to process.
File names should start at the first column. It is possible to
put comments to the listfile after // characters. For example,
you may create backup.lst containing the following strings:
c:\work\doc\*.txt //backup text documents
c:\work\image\*.bmp //backup pictures
c:\work\misc
and then run:
rar a backup @backup.lst
If you wish to read file names from stdin (standard input),
specify the empty listfile name (just @).
By default, console RAR uses the single byte encoding in list files,
but it can be redefined with -sc<charset>l switch.
You may specify both usual file names and list files in the same
command line. If neither files nor listfiles are specified,
then *.* is implied and RAR will process all files.
Many RAR commands, such as extraction, test or list, allow to use
wildcards in archive name. If no extension is specified in archive
mask, RAR assumes .rar, so * means all archives with .rar extension.
If you need to process all archives without extension, use *. mask.
*.* mask selects all files. Wildcards in archive name are not allowed
when archiving and deleting.
In Unix you need to enclose RAR command line parameters containing
wildcards in single or double quotes to prevent their expansion
by Unix shell. For example, this command will extract *.asm files
from all *.rar archives in current directory:
rar e '*.rar' '*.asm'
Command could be any of the following:
a Add files to archive.
Examples:
1) add all *.hlp files from the current directory to
the archive help.rar:
rar a help *.hlp
2) archive all files from the current directory and subdirectories
to 362000 bytes size solid, self-extracting volumes
and add the recovery record to each volume:
rar a -r -v362 -s -sfx -rr save
Because no file names are specified, all files (*) are assumed.
3) as a special exception, if directory name is specified as
an argument and if directory name does not include file masks
and trailing backslashes, the entire contents of the directory
and all subdirectories will be added to the archive even
if switch -r is not specified.
The following command will add all files from the directory
Bitmaps and its subdirectories to the RAR archive Pictures.rar:
rar a Pictures.rar Bitmaps
4) if directory name includes file masks or trailing backslashes,
normal rules apply and you need to specify switch -r to process
its subdirectories.
The following command will add all files from directory Bitmaps,
but not from its subdirectories, because switch -r is not
specified:
rar a Pictures.rar Bitmaps\*
c Add archive comment. Comments are displayed while the archive is
being processed. Comment length is limited to 256 KB.
Examples:
rar c distrib.rar
Also comments may be added from a file using -z[file] switch.
The following command adds a comment from info.txt file:
rar c -zinfo.txt dummy
ch Change archive parameters.
This command can be used with most of archive modification
switches to modify archive parameters. It is especially
convenient for switches like -cl, -cu, -tl, which do not
have a dedicated command.
It is not able to recompress, encrypt or decrypt archive data
and it cannot merge or create volumes. If used without any
switches, 'ch' command just copies the archive data without
modification.
Example:
Set archive time to latest file:
rar ch -tl files.rar
cw Write archive comment to specified file.
Format of output file depends on -sc switch.
If output file name is not specified, comment data will be
sent to stdout.
Examples:
1) rar cw arc comment.txt
2) rar cw -scuc arc unicode.txt
3) rar cw arc
d Delete files from archive. Please note if the processing of this
command results in removing all the files from the archive,
the empty archive would removed.
e Extract files without archived paths.
Extract files excluding their path component, so all files
are created in the same destination directory.
Use 'x' command if you wish to extract full pathnames.
Example:
rar e -or html.rar *.css css\
extract all *.css files from html.rar archive to 'css' folder
excluding archived paths. Rename extracted files automatically
in case several files have the same name.
f Freshen files in archive. Updates archived files older
than files to add. This command will not add new files
to the archive.
i[i|c|h|t]=<string>
Find string in archives.
Supports following optional parameters:
i - case insensitive search (default);
c - case sensitive search;
h - hexadecimal search;
t - use ANSI, Unicode and OEM character tables (Windows only);
If no parameters are specified, it is possible to use
the simplified command syntax i<string> instead of i=<string>
It is allowed to specify 't' modifier with other parameters,
for example, ict=string performs case sensitive search
using all mentioned above character tables.
Examples:
1) rar "ic=first level" -r c:\*.rar *.txt
Perform case sensitive search of "first level" string
in *.txt files in *.rar archives on the disk c:
2) rar ih=f0e0aeaeab2d83e3a9 -r e:\texts\*.rar
Search for hex string f0 e0 ae ae ab 2d 83 e3 a9
in rar archives in e:\texts directory.
k Lock archive. Any command which intends to change the archive
will be ignored.
Example:
rar k final.rar
l[t[a],b]
List archive contents [technical [all], bare].
'l' command lists archived file attributes, size, date,
time and name, one file per line. If file is encrypted,
line starts from '*' character.
'lt' displays the detailed file information in multiline mode.
This information includes file checksum value, host OS,
compression options and other parameters.
'lta' provide the detailed information not only for files,
but also for service headers like NTFS streams
or file security data.
'lb' lists bare file names with path, one per line,
without any additional information.
You can use -v switch to list contents of all volumes
in volume set: rar l -v vol.part1.rar
Commands 'lt', 'lta' and 'lb' are equal to 'vt', 'vta'
and 'vb' correspondingly.
m[f] Move to archive [files only]. Moving files and directories
results in the files and directories being erased upon
successful completion of the packing operation. Directories will
not be removed if 'f' modifier is used and/or '-ed' switch is
applied.
p Print file to stdout.
You may use this command together with -inul switch to disable
all RAR messages and print only file data. It may be important
when you need to send a file to stdout for use in pipes.
r Repair archive. Archive repairing is performed in two stages.
First, the damaged archive is searched for a recovery record
(see 'rr' command). If archive contains the previously added
recovery record and if damaged data area is continuous
and smaller than error correction code size in recovery record,
chance of successful archive reconstruction is high.
When this stage has been completed, a new archive is created,
named as fixed.arcname.rar, where 'arcname' is the original
(damaged) archive name.
If broken archive does not contain a recovery record or if
archive is not completely recovered due to major damage,
second stage is performed. During this stage only the archive
structure is reconstructed and it is impossible to recover
files which fail checksum validation, it is still possible,
however, to recover undamaged files, which were inaccessible
due to the broken archive structure. Mostly this is useful
for non-solid archives. This stage is never efficient
for archives with encrypted file headers, which can be repaired
only if recovery record is present.
When the second stage is completed, the reconstructed archive
is saved as rebuilt.arcname.rar, where 'arcname' is
the original archive name.
By default, repaired archives are created in the current
directory, but you can append an optional destpath\ parameter
to specify another destination directory.
Example:
rar r buggy.rar c:\fixed\
repair buggy.rar and place the result to 'c:\fixed' directory.
rc Reconstruct missing and damaged volumes using recovery volumes
(.rev files). You need to specify any existing volume
as the archive name, for example, 'rar rc backup.part03.rar'
Read 'rv' command description for information about
recovery volumes.
rn Rename archived files.
The command syntax is:
rar rn <arcname> <srcname1> <destname1> ... <srcnameN> <destnameN>
For example, the following command:
rar rn data.rar readme.txt readme.bak info.txt info.bak
will rename readme.txt to readme.bak and info.txt to info.bak
in the archive data.rar.
It is allowed to use wildcards in the source and destination
names for simple name transformations like changing file
extensions. For example:
rar rn data.rar *.txt *.bak
will rename all *.txt files to *.bak.
RAR does not check if the destination file name is already
present in the archive, so you need to be careful to avoid
duplicated names. It is especially important when using
wildcards. Such a command is potentially dangerous, because
a wrong wildcard may corrupt all archived names.
rr[N] Add data recovery record. Optionally, redundant information
(recovery record) may be added to archive. While it increases
the archive size, it helps to recover archived files in case of
disk failure or data loss of other kind, provided that damage
is not too severe. Such damage recovery can be done with
command "r" (repair).
RAR 4.x and RAR 5.0 archives use different recovery record
structure and algorithms.
RAR 4.x recovery record is based on XOR algorithm.
You can specify 4.x record size as a number of recovery sectors
or as a percent of archive size. To specify a number of sectors
just add it directly after 'rr', like 'rr1000' for 1000 sectors.
To use a percent append 'p' or '%' modifier after the percent
number, such as 'rr5p' or 'rr5%' for 5%. Note that in Windows
.bat and .cmd files it is necessary to use 'rr5%%' instead of
'rr5%', because the command processor treats the single '%'
as the start of a batch file parameter, so it might be more
convenient to use 'p' instead of '%' in this case.
RAR 4.x recovery sectors are 512 bytes long. If damaged area
is continuous, every sector helps to recover 512 bytes of
damaged information. This value may be lower in cases of
multiple damage. Maximum number of recovery sectors is 524288.
Size of 4.x recovery record may be approximately determined as
<archive size>/256 + <number of recovery sectors>*512 bytes.
RAR 5.0 recovery record uses Reed-Solomon error correction codes.
Its ability to repair continuous damage is about the same
as for RAR 4.x, allowing to restore slightly less data than
recovery record size. But it is significantly more efficient
than RAR 4.x record in case of multiple damaged areas.
RAR 5.0 record does not use 512 byte sectors and you can specify
its size only as a percent of archive size. Even if '%' or 'p'
modifier is not present, RAR treats the value as a percent
in case of RAR 5.0 format, so both 'rr5' and 'rr5p' mean 5%.
Due to service data overhead the actual resulting recovery record
size only approximately matches the user defined percent
and difference is larger for smaller archives.
RAR 5.0 recovery record size cannot exceed the protecting
archive size, so you cannot use more than 100% as a parameter.
Larger recovery records are processed slower both when creating
and repairing.
RAR 5.0 recovery record is more resistant to damage of recovery
record itself and can utilize a partially corrupt recovery
record data. Note, though, that 'R' repair command does not fix
broken blocks in recovery record. Only file data are corrected.
After successful archive repair, you may need to create a new
recovery record for saved files.
Both 4.x and 5.0 records are most efficient if data positions
in damaged archive are not shifted. If you copy an archive
from damaged media using some special software and if you have
a choice to fill damaged areas with zeroes or to cut out them
from copied file, filling with zeroes or any other value is
preferable, because it allows to preserve original data positions.
Still, even though it is not an optimal mode, both versions
of records attempt to repair data even in case of deletions
or insertions of reasonable size, when data positions were
shifted. RAR 5.0 recovery record handles deletions and insertions
more efficiently than RAR 4.x.
If you use the plain 'rr' command without optional parameter,
RAR will set the recovery record size to 3% of archive size
by default.
Example:
rar rr5p arcname
add the recovery record of 5% of archive size.
rv[N] Create recovery volumes (.rev files), which can be later
used to reconstruct missing and damaged files in a volume
set. This command makes sense only for multivolume archives
and you need to specify the name of the first volume
in the set as the archive name. For example:
rar rv3 data.part01.rar
This feature may be useful for backups or, for example,
when you posted a multivolume archive to a newsgroup
and a part of subscribers did not receive some of the files.
Reposting recovery volumes instead of usual volumes
may reduce the total number of files to repost.
Each recovery volume is able to reconstruct one missing
or damaged RAR volume. For example, if you have 30 volumes
and 3 recovery volumes, you are able to reconstruct any
3 missing volumes. If the number of .rev files is less than
the number of missing volumes, reconstructing is impossible.
The total number of usual and recovery volumes must not
exceed 255 for RAR 4.x and 65535 for RAR 5.0 archive format.
Original RAR volumes must not be modified after creating
recovery volumes. Recovery algorithm uses data stored both
in REV files and in RAR volumes to rebuild missing RAR volumes.
So if you modify RAR volumes, for example, lock them, after
creating REV files, recovery process will fail.
Additionally to recovery data, RAR 5.0 recovery volumes
also store service information such as checksums of protected
RAR files. So they are slightly larger than RAR volumes
which they protect. If you plan to copy individual RAR and REV
files to some removable media, you need to take it into account
and specify RAR volume size by a few kilobytes smaller
than media size.
The optional <N> parameter specifies a number of recovery
volumes to create and must be less than the total number
of RAR volumes in the set. You may also append a percent
or 'p' character to this parameter, in such case the number of
creating .rev files will be equal to this percent taken
from the total number of RAR volumes. For example:
rar rv15% data.part01.rar
RAR reconstructs missing and damaged volumes either when
using 'rc' command or automatically, if it cannot locate
the next volume and finds the required number of .rev files
when unpacking.
Original copies of damaged volumes are renamed to *.bad
before reconstruction. For example, volname.part03.rar
will be renamed to volname.part03.rar.bad.
s[name] Convert archive to SFX. The archive is merged with a SFX module
(using a module in file default.sfx or specified in the switch).
In the Windows version default.sfx should be placed in the
same directory as the rar.exe, in Unix - in the user's
home directory, in /usr/lib or /usr/local/lib.
s- Remove SFX module from the already existing SFX archive.
RAR creates a new archive without SFX module, the original
SFX archive is not deleted.
t Test archive files. This command performs a dummy file
extraction, writing nothing to the output stream, in order to
validate the specified file(s).
Examples:
Test archives in current directory:
rar t *
or for Unix:
rar t '*'
User may test archives in all sub-directories, starting
with the current path:
rar t -r *
or for Unix:
rar t -r '*'
u Update files in archive. Adds files not yet in the archive
and updates archived files that are older than files to add.
v[t[a],b]
Verbosely list archive contents [technical [all], bare].
'v' command lists archived file attributes, size, packed size,
compression ratio, date, time, checksum and name, one file
per line. If file is encrypted, line starts from '*' character.
For BLAKE2sp checksum only two first and one last symbol are
displayed.
'vt' displays the detailed file information in multiline mode.
This information includes file checksum value, host OS,
compression options and other parameters.
'vta' provide the detailed information not only for files,
but also for service headers like NTFS streams
or file security data.
'vb' lists bare file names with path, one per line,
without any additional information.
You can use -v switch to list contents of all volumes
in volume set: rar v -v vol.part1.rar
Commands 'vt', 'vta' and 'vb' are equal to 'lt', 'lta'
and 'lb' correspondingly.
x Extract files with full path.
Examples:
1) extract 10cents.txt to current directory not displaying
the archive comment
rar x -c- dime 10cents.txt
2) extract *.txt from docs.rar to c:\docs directory
rar x docs.rar *.txt c:\docs\
3) extract the entire contents of docs.rar to current directory
rar x docs.rar
Switches (used in conjunction with a command):
-? Display help on commands and switches. The same as when none
or an illegal command line option is entered.
-- Stop switches scanning
This switch tells to RAR that there are no more switches
in the command line. It could be useful, if either archive
or file name starts from '-' character. Without '--' switch
such a name would be treated as a switch.
Example:
add all files from the current directory to the solid archive
'-StrangeName'
RAR a -s -- -StrangeName
-@[+] Disable [enable] file lists
RAR treats command line parameters starting from '@' character
as file lists. So by default, RAR attempts to read 'filename'
filelist, when encountering '@filename' parameter.
But if '@filename' file exists, RAR treats the parameter
as '@filename' file instead of reading the file list.
Switch -@[+] allows to avoid this ambiguity and strictly
define how to handle parameters starting from '@' character.
If you specify -@, all such parameters found after this switch
will be considered as file names, not file lists.
If you specify -@+, all such parameters found after this switch
will be considered as file lists, not file names.
This switch does not affect processing parameters located
before it.
Example:
test the archived file '@home'
rar t -@ notes.rar @home
-ac Clear Archive attribute after compression or extraction
(Windows version only).
If -ac is specified when archiving, "Archive" file attribute
is cleared for successfully compressed files. When extracting,
-ac will clear "Archive" attribute for extracted files.
This switch does not affect directory attributes.
-ad Append archive name to destination path.
This option may be useful when unpacking a group of archives.
By default RAR places files from all archives in the same
directory, but this switch creates a separate directory
for files unpacked from each archive.
Example:
rar x -ad *.rar data\
RAR will create subdirectories below 'data' for every unpacking
archive.
-ag[format]
Generate archive name using the current date and time.
Appends the current date string to an archive name when
creating or processing an archive. Useful for daily backups.
Format of the appending string is defined by the optional
"format" parameter or by "YYYYMMDDHHMMSS" if this parameter
is absent. The format string may include the following
characters:
Y - year
M - month
MMM - month name as text string (Jan, Feb, etc.)
W - a week number (a week starts with Monday)
A - day of week number (Monday is 1, Sunday - 7)
D - day of month
E - day of year
H - hours
M - minutes (treated as minutes if encountered after hours)
I - minutes (treated as minutes regardless of hours position)
S - seconds
N - archive number. RAR searches for already existing archive
with generated name and if found, increments the archive
number until generating a unique name. 'N' format character
is not supported when creating volumes.
When performing non-archiving operations like extracting,
RAR selects the existing archive preceding the first
unused name or sets N to 1 if no such archive exists.
Each of format string characters listed above represents only
one character added to archive name. For example, use WW for
two digit week number or YYYY to define four digit year.
If the first character in the format string is '+', positions
of the date string and base archive name are exchanged,
so a date will precede an archive name.
The format string may contain optional text enclosed in '{'
and '}' characters. This text is inserted into archive name.
All other characters are added to an archive name without
changes.
If you need to process an already existing archive, be careful
with -ag switch. Depending on the format string and time passed
since previous -ag use, generated and existing archive names
may mismatch. In this case RAR will create or open a new archive
instead of processing the already existing one. You may use
-log switch to write the generated archive name to a file
and then read it from file for further processing.
Examples:
1) use the default YYYYMMDDHHMMSS format
rar a -ag backup
2) use DD-MMM-YY format
rar t -agDD-MMM-YY backup
3) use YYYYMMDDHHMM format, place date before 'backup'
rar a -ag+YYYYMMDDHHMM backup
4) use YYYY-WW-A format, include fields description
rar a -agYYYY{year}-WW{week}-A{wday} backup
5) use YYYYMMDD and the archive number. It allows to generate
unique names even when YYYYMMDD format mask used more than
once in the same day
rar a -agYYYYMMDD-NN backup
-ai Ignore file attributes.
If this switch is used when extracting, RAR does not set
general file attributes stored in archive to extracted files.
This switch preserves attributes assigned by operating system
to a newly created file.
If this switch is used when archiving, predefined values,
typical for file and directory, are stored instead of actual
attributes.
In Windows it affects archive, system, hidden and read-only
attributes. in Unix - user, group, and others file permissions.
-ao Add files with "Archive" attribute set
(Windows version only).
If -ao is used when archiving, only files with "Archive"
file attribute will be added to archive. This switch does not
affect directories, so all matching directories are added
regardless of their attributes. You can also specify -ed switch
if you prefer to omit all directory records.
Example:
add all disk C: files with "Archive" attribute set
to the 'f:backup' and clear files "Archive" attribute
rar a -r -ac -ao f:backup c:\*.*
-ap Set path inside archive. This path is merged to file
names when adding files to an archive and removed
from file names when extracting.
For example, if you wish to add the file 'readme.txt'
to the directory 'DOCS\ENG' of archive 'release',
you may run:
rar a -apDOCS\ENG release readme.txt
or to extract 'ENG' to the current directory:
rar x -apDOCS release DOCS\ENG\*.*
-as Synchronize archive contents
If this switch is used when archiving, those archived files
which are not present in the list of the currently added
files, will be deleted from the archive. It is convenient to
use this switch in combination with -u (update) to synchronize
contents of an archive and an archiving directory.
For example, after the command:
rar a -u -as backup sources\*.cpp
the archive 'backup.rar' will contain only *.cpp files
from directory 'sources', all other files will be deleted
from the archive. It looks similar to creating a new archive,
but with one important exception: if no files are modified
since the last backup, the operation is performed much faster
than the creation of a new archive.
-cfg- Ignore configuration file and RAR environment variable.
-cl Convert file names to lower case.
-cu Convert file names to upper case.
-c- Disable comments show.
-df Delete files after archiving
Move files to archive. This switch in combination with
the command "A" performs the same action as the command "M".
-dh Open shared files
Allows to process files opened by other applications
for writing.
This switch helps if an application allowed read access
to file, but if all types of file access are prohibited,
the file open operation will still fail.
This option could be dangerous, because it allows
to archive a file, which at the same time is modified
by another application, so use it carefully.
-dr Delete files to Recycle Bin
Delete files after archiving and place them to Recycle Bin.
Available in Windows version only.
-ds Do not sort files while adding to a solid archive.
-dw Wipe files after archiving
Delete files after archiving. Before deleting file data
are overwritten by zero bytes to prevent recovery of deleted
files, file is truncated and renamed to temporary name.
Please be aware that such approach is designed for usual
hard disks, but may fail to overwrite the original file data
on solid state disks, as result of SSD wear leveling technology
and more complicated data addressing.
-ed Do not add empty directories
This switch indicates that directory records are not to be
stored in the created archive. When extracting such archives,
RAR creates non-empty directories based on paths of files
contained in them. Information about empty directories is
lost. All attributes of non-empty directories except a name
(access rights, streams, etc.) will be lost as well, so use
this switch only if you do not need to preserve such information.
If -ed is used with 'm' command or -df switch, RAR will not
remove empty directories.
-en Do not add "end of archive" block
Not supported for RAR 5.0 archives.
By default, RAR adds an "end of archive" block to the end of
a new or updated archive. It allows to skip external data like
digital signatures safely, but in some special cases it may be
useful to disable this feature. For example, if an archive
is transferred between two systems via an unreliable link and
at the same time a sender adds new files to it, it may be
important to be sure that the already received file part will
not be modified on the other end between transfer sessions.
This switch cannot be used with volumes, because the end
of archive block contains information important for correct
volume processing.
-ep Exclude paths from names. This switch enables files to be
added to an archive without including the path information.
This could, of course, result in multiple files existing
in the archive with the same name.
If used when extracting, archived paths are ignored
for extracted files, so all files are created in the same
destination directory.
-ep1 Exclude base dir from names. Do not store or extract the path
entered in the command line. Ignored if path includes wildcards.
Examples:
1) add all files and directories from 'tmp' directory to archive
'test', but exclude 'tmp\' from archived names path:
rar a -ep1 -r test tmp\*
This is an equivalent to commands:
cd tmp
rar a -r ..\test
cd ..
2) extract files matching images\* mask to dest\ directory,
but remove 'images\' from paths of created files:
rar x -ep1 data images\* dest\
-ep2 Expand paths to full. Store full file paths (except the drive
letter and leading path separator) when archiving.
-ep3 Expand paths to full including the drive letter.
Windows version only.
This switch stores full file paths including the drive
letter if used when archiving. Drive separators (colons)
are replaced by underscore characters.