在Mac上解压和压缩文件夹

本文的主要目的是把tar和rar的manual复制出来方便查询。

使用Finder或者在终端中使用tar命令

Finder比较简单,也是苹果官方推荐的方法

使用tar命令,需要先cd到用所文件所在的文件夹,然后进行压缩:

对于进行基础压缩的文件夹(例如,名为“LotsOfFiles”),你可以输入:
% tar -czf LotsOfFiles.tgz LotsOfFiles
z 旗标表示归档正在被压缩,并正在组合成一个文件。你通常会用到这个选项,但这并非必须。
如果文件夹较大,你不妨添加 v 旗标来监视进程:
% tar -czvf LotsOfFiles.tgz LotsOfFiles

或者解压缩:

在 Mac 上的“终端” App 中,输入带 x 旗标的 tar 命令,然后按下 Return 键。若要查看进程信息,还可以使用 v 旗标。例如:
% tar -xvf LotsOfFiles.tgz

Manual for tar:

SYNOPSIS
tar [bundled-flags ⟨args⟩] [⟨file⟩ | ⟨pattern⟩ …]
tar {-c} [options] [files | directories]
tar {-r | -u} -f archive-file [options] [files | directories]
tar {-t | -x} [options] [patterns]

DESCRIPTION
tar creates and manipulates streaming archive files. This implementation can extract from tar, pax, cpio, zip, jar, ar, xar, rpm, 7-zip, and ISO 9660 cdrom images and can create tar, pax, cpio, ar, zip, 7-zip, and shar archives.

 The first synopsis form shows a “bundled” option word.  This usage is
 provided for compatibility with historical implementations.  See
 COMPATIBILITY below for details.

 The other synopsis forms show the preferred usage.  The first option to
 tar is a mode indicator from the following list:
 -c      Create a new archive containing the specified items.  The long
         option form is --create.
 -r      Like -c, but new entries are appended to the archive.  Note that
         this only works on uncompressed archives stored in regular files.
         The -f option is required.  The long option form is --append.
 -t      List archive contents to stdout.  The long option form is --list.
 -u      Like -r, but new entries are added only if they have a
         modification date newer than the corresponding entry in the
         archive.  Note that this only works on uncompressed archives
         stored in regular files.  The -f option is required.  The long
         form is --update.
 -x      Extract to disk from the archive.  If a file with the same name
         appears more than once in the archive, each copy will be
         extracted, with later copies overwriting (replacing) earlier
         copies.  The long option form is --extract.

 In -c, -r, or -u mode, each specified file or directory is added to the
 archive in the order specified on the command line.  By default, the
 contents of each directory are also archived.

 In extract or list mode, the entire command line is read and parsed
 before the archive is opened.  The pathnames or patterns on the command
 line indicate which items in the archive should be processed.  Patterns
 are shell-style globbing patterns as documented in tcsh(1).

OPTIONS
Unless specifically stated otherwise, options are applicable in all
operating modes.

 @archive
         (c and r modes only) The specified archive is opened and the
         entries in it will be appended to the current archive.  As a
         simple example,
               tar -c -f - newfile @original.tar
         writes a new archive to standard output containing a file newfile
         and all of the entries from original.tar.  In contrast,
               tar -c -f - newfile original.tar
         creates a new archive with only two entries.  Similarly,
               tar -czf - --format pax @-
         reads an archive from standard input (whose format will be
         determined automatically) and converts it into a gzip-compressed
         pax-format archive on stdout.  In this way, tar can be used to
         convert archives from one format to another.

 -a, --auto-compress
         (c mode only) Use the archive suffix to decide a set of the
         format and the compressions.  As a simple example,
               tar -a -cf archive.tgz source.c source.h
         creates a new archive with restricted pax format and gzip
         compression,
               tar -a -cf archive.tar.bz2.uu source.c source.h
         creates a new archive with restricted pax format and bzip2
         compression and uuencode compression,
               tar -a -cf archive.zip source.c source.h
         creates a new archive with zip format,
               tar -a -jcf archive.tgz source.c source.h
         ignores the “-j” option, and creates a new archive with
         restricted pax format and gzip compression,
               tar -a -jcf archive.xxx source.c source.h
         if it is unknown suffix or no suffix, creates a new archive with
         restricted pax format and bzip2 compression.

 --acls  (c, r, u, x modes only) Archive or extract POSIX.1e or NFSv4
         ACLs.  This is the reverse of --no-acls and the default behavior
         in c, r, and u modes (except on Mac OS X) or if tar is run in x
         mode as root.  On Mac OS X this option translates extended ACLs
         to NFSv4 ACLs.  To store extended ACLs the --mac-metadata option
         is preferred.

 -B, --read-full-blocks
         Ignored for compatibility with other tar(1) implementations.

 -b blocksize, --block-size blocksize
         Specify the block size, in 512-byte records, for tape drive I/O.
         As a rule, this argument is only needed when reading from or
         writing to tape drives, and usually not even then as the default
         block size of 20 records (10240 bytes) is very common.

 -C directory, --cd directory, --directory directory
         In c and r mode, this changes the directory before adding the
         following files.  In x mode, change directories after opening the
         archive but before extracting entries from the archive.

 --chroot
         (x mode only) chroot() to the current directory after processing
         any -C options and before extracting any files.

 --clear-nochange-fflags
         (x mode only) Before removing file system objects to replace
         them, clear platform-specific file attributes or file flags that
         might prevent removal.

 --exclude pattern
         Do not process files or directories that match the specified
         pattern.  Note that exclusions take precedence over patterns or
         filenames specified on the command line.

 --exclude-vcs
         Do not process files or directories internally used by the
         version control systems ‘Arch’, ‘Bazaar’, ‘CVS’, ‘Darcs’,
         ‘Mercurial’, ‘RCS’, ‘SCCS’, ‘SVN’ and ‘git’.

 --fflags
         (c, r, u, x modes only) Archive or extract platform-specific file
         attributes or file flags.  This is the reverse of --no-fflags and
         the default behavior in c, r, and u modes or if tar is run in x
         mode as root.

 --format format
         (c, r, u mode only) Use the specified format for the created
         archive.  Supported formats include “cpio”, “pax”, “shar”, and
         “ustar”.  Other formats may also be supported; see
         libarchive-formats(5) for more information about currently-
         supported formats.  In r and u modes, when extending an existing
         archive, the format specified here must be compatible with the
         format of the existing archive on disk.

 -f file, --file file
         Read the archive from or write the archive to the specified file.
         The filename can be - for standard input or standard output.  The
         default varies by system; on FreeBSD, the default is /dev/sa0; on
         Linux, the default is /dev/st0.

 --gid id
         Use the provided group id number.  On extract, this overrides the
         group id in the archive; the group name in the archive will be
         ignored.  On create, this overrides the group id read from disk;
         if --gname is not also specified, the group name will be set to
         match the group id.

 --gname name
         Use the provided group name.  On extract, this overrides the
         group name in the archive; if the provided group name does not
         exist on the system, the group id (from the archive or from the
         --gid option) will be used instead.  On create, this sets the
         group name that will be stored in the archive; the name will not
         be verified against the system group database.

 -H      (c and r modes only) Symbolic links named on the command line
         will be followed; the target of the link will be archived, not
         the link itself.

 -h      (c and r modes only) Synonym for -L.

 -I      Synonym for -T.

 --help  Show usage.

 --hfsCompression
         (x mode only) Mac OS X specific (v10.6 or later). Compress
         extracted regular files with HFS+ compression.

 --ignore-zeros
         An alias of --options read_concatenated_archives for
         compatibility with GNU tar.

 --include pattern
         Process only files or directories that match the specified
         pattern.  Note that exclusions specified with --exclude take
         precedence over inclusions.  If no inclusions are explicitly
         specified, all entries are processed by default.  The --include
         option is especially useful when filtering archives.  For
         example, the command
               tar -c -f new.tar --include='*foo*' @old.tgz
         creates a new archive new.tar containing only the entries from
         old.tgz containing the string ‘foo’.

 -J, --xz
         (c mode only) Compress the resulting archive with xz(1).  In
         extract or list modes, this option is ignored.  Note that this
         tar implementation recognizes XZ compression automatically when
         reading archives.

 -j, --bzip, --bzip2, --bunzip2
         (c mode only) Compress the resulting archive with bzip2(1).  In
         extract or list modes, this option is ignored.  Note that this
         tar implementation recognizes bzip2 compression automatically
         when reading archives.

 -k, --keep-old-files
         (x mode only) Do not overwrite existing files.  In particular, if
         a file appears more than once in an archive, later copies will
         not overwrite earlier copies.

 --keep-newer-files
         (x mode only) Do not overwrite existing files that are newer than
         the versions appearing in the archive being extracted.

 -L, --dereference
         (c and r modes only) All symbolic links will be followed.
         Normally, symbolic links are archived as such.  With this option,
         the target of the link will be archived instead.

 -l, --check-links
         (c and r modes only) Issue a warning message unless all links to
         each file are archived.

 --lrzip
         (c mode only) Compress the resulting archive with lrzip(1).  In
         extract or list modes, this option is ignored.  Note that this
         tar implementation recognizes lrzip compression automatically
         when reading archives.

 --lz4   (c mode only) Compress the archive with lz4-compatible
         compression before writing it.  In extract or list modes, this
         option is ignored.  Note that this tar implementation recognizes
         lz4 compression automatically when reading archives.

 --zstd  (c mode only) Compress the archive with zstd-compatible
         compression before writing it.  In extract or list modes, this
         option is ignored.  Note that this tar implementation recognizes
         zstd compression automatically when reading archives.

 --lzma  (c mode only) Compress the resulting archive with the original
         LZMA algorithm.  In extract or list modes, this option is
         ignored.  Use of this option is discouraged and new archives
         should be created with --xz instead.  Note that this tar
         implementation recognizes LZMA compression automatically when
         reading archives.

 --lzop  (c mode only) Compress the resulting archive with lzop(1).  In
         extract or list modes, this option is ignored.  Note that this
         tar implementation recognizes LZO compression automatically when
         reading archives.

 -m, --modification-time
         (x mode only) Do not extract modification time.  By default, the
         modification time is set to the time stored in the archive.

 --mac-metadata
         (c, r, u and x mode only) Mac OS X specific.  Archive or extract
         extended ACLs and extended file attributes using copyfile(3) in
         AppleDouble format.  This is the reverse of --no-mac-metadata.
         and the default behavior in c, r, and u modes or if tar is run in
         x mode as root.

 -n, --norecurse, --no-recursion
         Do not operate recursively on the content of directories.

 --newer date
         (c, r, u modes only) Only include files and directories newer
         than the specified date.  This compares ctime entries.

 --newer-mtime date
         (c, r, u modes only) Like --newer, except it compares mtime
         entries instead of ctime entries.

 --newer-than file
         (c, r, u modes only) Only include files and directories newer
         than the specified file.  This compares ctime entries.

 --newer-mtime-than file
         (c, r, u modes only) Like --newer-than, except it compares mtime
         entries instead of ctime entries.

 --nodump
         (c and r modes only) Honor the nodump file flag by skipping this
         file.

 --nopreserveHFSCompression
         (x mode only) Mac OS X specific (v10.6 or later). Do not compress
         extracted regular files which were compressed with HFS+
         compression before archived.  By default, compress the regular
         files again with HFS+ compression.

 --null  (use with -I or -T) Filenames or patterns are separated by null
         characters, not by newlines.  This is often used to read
         filenames output by the -print0 option to find(1).

 --no-acls
         (c, r, u, x modes only) Do not archive or extract POSIX.1e or
         NFSv4 ACLs.  This is the reverse of --acls and the default
         behavior if tar is run as non-root in x mode (on Mac OS X as any
         user in c, r, u and x modes).

 --no-fflags
         (c, r, u, x modes only) Do not archive or extract file attributes
         or file flags.  This is the reverse of --fflags and the default
         behavior if tar is run as non-root in x mode.

 --no-mac-metadata
         (x mode only) Mac OS X specific.  Do not archive or extract ACLs
         and extended file attributes using copyfile(3) in AppleDouble
         format.  This is the reverse of --mac-metadata.  and the default
         behavior if tar is run as non-root in x mode.

 --no-safe-writes
         (x mode only) Do not create temporary files and use rename(2) to
         replace the original ones.  This is the reverse of --safe-writes.

 --no-same-owner
         (x mode only) Do not extract owner and group IDs.  This is the
         reverse of --same-owner and the default behavior if tar is run as
         non-root.

 --no-same-permissions
         (x mode only) Do not extract full permissions (SGID, SUID, sticky
         bit, file attributes or file flags, extended file attributes and
         ACLs).  This is the reverse of -p and the default behavior if tar
         is run as non-root.

 --no-xattrs
         (c, r, u, x modes only) Do not archive or extract extended file
         attributes.  This is the reverse of --xattrs and the default
         behavior if tar is run as non-root in x mode.

 --numeric-owner
         This is equivalent to --uname "" --gname "".  On extract, it
         causes user and group names in the archive to be ignored in favor
         of the numeric user and group ids.  On create, it causes user and
         group names to not be stored in the archive.

 -O, --to-stdout
         (x, t modes only) In extract (-x) mode, files will be written to
         standard out rather than being extracted to disk.  In list (-t)
         mode, the file listing will be written to stderr rather than the
         usual stdout.

 -o      (x mode) Use the user and group of the user running the program
         rather than those specified in the archive.  Note that this has
         no significance unless -p is specified, and the program is being
         run by the root user.  In this case, the file modes and flags
         from the archive will be restored, but ACLs or owner information
         in the archive will be discarded.

 -o      (c, r, u mode) A synonym for --format ustar

 --older date
         (c, r, u modes only) Only include files and directories older
         than the specified date.  This compares ctime entries.

 --older-mtime date
         (c, r, u modes only) Like --older, except it compares mtime
         entries instead of ctime entries.

 --older-than file
         (c, r, u modes only) Only include files and directories older
         than the specified file.  This compares ctime entries.

 --older-mtime-than file
         (c, r, u modes only) Like --older-than, except it compares mtime
         entries instead of ctime entries.

 --one-file-system
         (c, r, and u modes) Do not cross mount points.

 --options options
         Select optional behaviors for particular modules.  The argument
         is a text string containing comma-separated keywords and values.
         These are passed to the modules that handle particular formats to
         control how those formats will behave.  Each option has one of
         the following forms:
         key=value
                 The key will be set to the specified value in every
                 module that supports it.  Modules that do not support
                 this key will ignore it.
         key     The key will be enabled in every module that supports it.
                 This is equivalent to key=1.
         !key    The key will be disabled in every module that supports
                 it.
         module:key=value, module:key, module:!key
                 As above, but the corresponding key and value will be
                 provided only to modules whose name matches module.

         The complete list of supported modules and keys for create and
         append modes is in archive_write_set_options(3) and for extract
         and list modes in archive_read_set_options(3).

         Examples of supported options:
         iso9660:joliet
                 Support Joliet extensions.  This is enabled by default,
                 use !joliet or iso9660:!joliet to disable.
         iso9660:rockridge
                 Support Rock Ridge extensions.  This is enabled by
                 default, use !rockridge or iso9660:!rockridge to disable.
         gzip:compression-level
                 A decimal integer from 1 to 9 specifying the gzip
                 compression level.
         gzip:timestamp
                 Store timestamp.  This is enabled by default, use
                 !timestamp or gzip:!timestamp to disable.
         lrzip:compression=type
                 Use type as compression method.  Supported values are
                 bzip2, gzip, lzo (ultra fast), and zpaq (best, extremely
                 slow).
         lrzip:compression-level
                 A decimal integer from 1 to 9 specifying the lrzip
                 compression level.
         lz4:compression-level
                 A decimal integer from 1 to 9 specifying the lzop
                 compression level.
         lz4:stream-checksum
                 Enable stream checksum.  This is by default, use
                 lz4:!stream-checksum to disable.
         lz4:block-checksum
                 Enable block checksum (Disabled by default).
         lz4:block-size
                 A decimal integer from 4 to 7 specifying the lz4
                 compression block size (7 is set by default).
         lz4:block-dependence
                 Use the previous block of the block being compressed for
                 a compression dictionary to improve compression ratio.
         zstd:compression-level
                 A decimal integer specifying the zstd compression level.
                 Supported values depend on the library version, common
                 values are from 1 to 22.
         lzop:compression-level
                 A decimal integer from 1 to 9 specifying the lzop
                 compression level.
         xz:compression-level
                 A decimal integer from 0 to 9 specifying the xz
                 compression level.
         mtree:keyword
                 The mtree writer module allows you to specify which mtree
                 keywords will be included in the output.  Supported
                 keywords include: cksum, device, flags, gid, gname,
                 indent, link, md5, mode, nlink, rmd160, sha1, sha256,
                 sha384, sha512, size, time, uid, uname.  The default is
                 equivalent to: “device, flags, gid, gname, link, mode,
                 nlink, size, time, type, uid, uname”.
         mtree:all
                 Enables all of the above keywords.  You can also use
                 mtree:!all to disable all keywords.
         mtree:use-set
                 Enable generation of /set lines in the output.
         mtree:indent
                 Produce human-readable output by indenting options and
                 splitting lines to fit into 80 columns.
         zip:compression=type
                 Use type as compression method.  Supported values are
                 store (uncompressed) and deflate (gzip algorithm).
         zip:encryption
                 Enable encryption using traditional zip encryption.
         zip:encryption=type
                 Use type as encryption type.  Supported values are
                 zipcrypt (traditional zip encryption), aes128 (WinZip
                 AES-128 encryption) and aes256 (WinZip AES-256
                 encryption).
         read_concatenated_archives
                 Ignore zeroed blocks in the archive, which occurs when
                 multiple tar archives have been concatenated together.
                 Without this option, only the contents of the first
                 concatenated archive would be read.  This option is
                 comparable to the -i, --ignore-zeros option of GNU tar.
         If a provided option is not supported by any module, that is a
         fatal error.

 -P, --absolute-paths
         Preserve pathnames.  By default, absolute pathnames (those that
         begin with a / character) have the leading slash removed both
         when creating archives and extracting from them.  Also, tar will
         refuse to extract archive entries whose pathnames contain .. or
         whose target directory would be altered by a symlink.  This
         option suppresses these behaviors.

 -p, --insecure, --preserve-permissions
         (x mode only) Preserve file permissions.  Attempt to restore the
         full permissions, including file modes, file attributes or file
         flags, extended file attributes and ACLs, if available, for each
         item extracted from the archive.  This is the reverse of
         --no-same-permissions and the default if tar is being run as
         root.  It can be partially overridden by also specifying
         --no-acls, --no-fflags, --no-mac-metadata or --no-xattrs.

 --passphrase passphrase
         The passphrase is used to extract or create an encrypted archive.
         Currently, zip is the only supported format that supports
         encryption.  You shouldn't use this option unless you realize how
         insecure use of this option is.

 --posix
         (c, r, u mode only) Synonym for --format pax

 -q, --fast-read
         (x and t mode only) Extract or list only the first archive entry
         that matches each pattern or filename operand.  Exit as soon as
         each specified pattern or filename has been matched.  By default,
         the archive is always read to the very end, since there can be
         multiple entries with the same name and, by convention, later
         entries overwrite earlier entries.  This option is provided as a
         performance optimization.

 -S      (x mode only) Extract files as sparse files.  For every block on
         disk, check first if it contains only NULL bytes and seek over it
         otherwise.  This works similar to the conv=sparse option of dd.

 -s pattern
         Modify file or archive member names according to pattern.  The
         pattern has the format /old/new/[ghHprRsS] where old is a basic
         regular expression, new is the replacement string of the matched
         part, and the optional trailing letters modify how the
         replacement is handled.  If old is not matched, the pattern is
         skipped.  Within new, ~ is substituted with the match, \1 to \9
         with the content of the corresponding captured group.  The
         optional trailing g specifies that matching should continue after
         the matched part and stop on the first unmatched pattern.  The
         optional trailing s specifies that the pattern applies to the
         value of symbolic links.  The optional trailing p specifies that
         after a successful substitution the original path name and the
         new path name should be printed to standard error.  Optional
         trailing H, R, or S characters suppress substitutions for
         hardlink targets, regular filenames, or symlink targets,
         respectively.  Optional trailing h, r, or s characters enable
         substitutions for hardlink targets, regular filenames, or symlink
         targets, respectively.  The default is hrs which applies
         substitutions to all names.  In particular, it is never necessary
         to specify h, r, or s.

 --safe-writes
         (x mode only) Extract files atomically.  By default tar unlinks
         the original file with the same name as the extracted file (if it
         exists), and then creates it immediately under the same name and
         writes to it.  For a short period of time, applications trying to
         access the file might not find it, or see incomplete results.  If
         --safe-writes is enabled, tar first creates a unique temporary
         file, then writes the new contents to the temporary file, and
         finally renames the temporary file to its final name atomically
         using rename(2).  This guarantees that an application accessing
         the file, will either see the old contents or the new contents at
         all times.

 --same-owner
         (x mode only) Extract owner and group IDs.  This is the reverse
         of --no-same-owner and the default behavior if tar is run as
         root.

 --strip-components count
         Remove the specified number of leading path elements.  Pathnames
         with fewer elements will be silently skipped.  Note that the
         pathname is edited after checking inclusion/exclusion patterns
         but before security checks.

 -T filename, --files-from filename
         In x or t mode, tar will read the list of names to be extracted
         from filename.  In c mode, tar will read names to be archived
         from filename.  The special name “-C” on a line by itself will
         cause the current directory to be changed to the directory
         specified on the following line.  Names are terminated by
         newlines unless --null is specified.  Note that --null also
         disables the special handling of lines containing “-C”.  Note:
         If you are generating lists of files using find(1), you probably
         want to use -n as well.

 --totals
         (c, r, u modes only) After archiving all files, print a summary
         to stderr.

 -U, --unlink, --unlink-first
         (x mode only) Unlink files before creating them.  This can be a
         minor performance optimization if most files already exist, but
         can make things slower if most files do not already exist.  This
         flag also causes tar to remove intervening directory symlinks
         instead of reporting an error.  See the SECURITY section below
         for more details.

 --uid id
         Use the provided user id number and ignore the user name from the
         archive.  On create, if --uname is not also specified, the user
         name will be set to match the user id.

 --uname name
         Use the provided user name.  On extract, this overrides the user
         name in the archive; if the provided user name does not exist on
         the system, it will be ignored and the user id (from the archive
         or from the --uid option) will be used instead.  On create, this
         sets the user name that will be stored in the archive; the name
         is not verified against the system user database.

 --use-compress-program program
         Pipe the input (in x or t mode) or the output (in c mode) through
         program instead of using the builtin compression support.

 -v, --verbose
         Produce verbose output.  In create and extract modes, tar will
         list each file name as it is read from or written to the archive.
         In list mode, tar will produce output similar to that of ls(1).
         An additional -v option will also provide ls-like details in
         create and extract mode.

 --version
         Print version of tar and libarchive, and exit.

 -w, --confirmation, --interactive
         Ask for confirmation for every action.

 -X filename, --exclude-from filename
         Read a list of exclusion patterns from the specified file.  See
         --exclude for more information about the handling of exclusions.

 --xattrs
         (c, r, u, x modes only) Archive or extract extended file
         attributes.  This is the reverse of --no-xattrs and the default
         behavior in c, r, and u modes or if tar is run in x mode as root.

 -y      (c mode only) Compress the resulting archive with bzip2(1).  In
         extract or list modes, this option is ignored.  Note that this
         tar implementation recognizes bzip2 compression automatically
         when reading archives.

 -Z, --compress, --uncompress
         (c mode only) Compress the resulting archive with compress(1).
         In extract or list modes, this option is ignored.  Note that this
         tar implementation recognizes compress compression automatically
         when reading archives.

 -z, --gunzip, --gzip
         (c mode only) Compress the resulting archive with gzip(1).  In
         extract or list modes, this option is ignored.  Note that this
         tar implementation recognizes gzip compression automatically when
         reading archives.

ENVIRONMENT
The following environment variables affect the execution of tar:

 TAR_READER_OPTIONS
                The default options for format readers and compression
                readers.  The --options option overrides this.

 TAR_WRITER_OPTIONS
                The default options for format writers and compression
                writers.  The --options option overrides this.

 LANG           The locale to use.  See environ(7) for more information.

 TAPE           The default device.  The -f option overrides this.  Please
                see the description of the -f option above for more
                details.

 TZ             The timezone to use when displaying dates.  See environ(7)
                for more information.

EXIT STATUS
The tar utility exits 0 on success, and >0 if an error occurs.

EXAMPLES
The following creates a new archive called file.tar.gz that contains two
files source.c and source.h:
tar -czf file.tar.gz source.c source.h

 To view a detailed table of contents for this archive:
       tar -tvf file.tar.gz

 To extract all entries from the archive on the default tape drive:
       tar -x

 To examine the contents of an ISO 9660 cdrom image:
       tar -tf image.iso

 To move file hierarchies, invoke tar as
       tar -cf - -C srcdir . | tar -xpf - -C destdir
 or more traditionally
       cd srcdir ; tar -cf - . | (cd destdir ; tar -xpf -)

 In create mode, the list of files and directories to be archived can also
 include directory change instructions of the form -Cfoo/baz and archive
 inclusions of the form @archive-file.  For example, the command line
       tar -c -f new.tar foo1 @old.tgz -C/tmp foo2
 will create a new archive new.tar.  tar will read the file foo1 from the
 current directory and add it to the output archive.  It will then read
 each entry from old.tgz and add those entries to the output archive.
 Finally, it will switch to the /tmp directory and add foo2 to the output
 archive.

 An input file in mtree(5) format can be used to create an output archive
 with arbitrary ownership, permissions, or names that differ from existing
 data on disk:

       $ cat input.mtree
       #mtree
       usr/bin uid=0 gid=0 mode=0755 type=dir
       usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls
       $ tar -cvf output.tar @input.mtree

 The --newer and --newer-mtime switches accept a variety of common date
 and time specifications, including “12 Mar 2005 7:14:29pm”, “2005-03-12
 19:14”, “5 minutes ago”, and “19:14 PST May 1”.

 The --options argument can be used to control various details of archive
 generation or reading.  For example, you can generate mtree output which
 only contains type, time, and uid keywords:
       tar -cf file.tar --format=mtree --options='!all,type,time,uid' dir
 or you can set the compression level used by gzip or xz compression:
       tar -czf file.tar --options='compression-level=9'.
 For more details, see the explanation of the archive_read_set_options()
 and archive_write_set_options() API calls that are described in
 archive_read(3) and archive_write(3).

COMPATIBILITY
The bundled-arguments format is supported for compatibility with historic
implementations. It consists of an initial word (with no leading –
character) in which each character indicates an option. Arguments follow
as separate words. The order of the arguments must match the order of
the corresponding characters in the bundled command word. For example,
tar tbf 32 file.tar
specifies three flags t, b, and f. The b and f flags both require
arguments, so there must be two additional items on the command line.
The 32 is the argument to the b flag, and file.tar is the argument to the
f flag.

 The mode options c, r, t, u, and x and the options b, f, l, m, o, v, and
 w comply with SUSv2.

 For maximum portability, scripts that invoke tar should use the bundled-
 argument format above, should limit themselves to the c, t, and x modes,
 and the b, f, m, v, and w options.

 Additional long options are provided to improve compatibility with other
 tar implementations.

SECURITY
Certain security issues are common to many archiving programs, including
tar. In particular, carefully-crafted archives can request that tar
extract files to locations outside of the target directory. This can
potentially be used to cause unwitting users to overwrite files they did
not intend to overwrite. If the archive is being extracted by the
superuser, any file on the system can potentially be overwritten. There
are three ways this can happen. Although tar has mechanisms to protect
against each one, savvy users should be aware of the implications:

 •       Archive entries can have absolute pathnames.  By default, tar
         removes the leading / character from filenames before restoring
         them to guard against this problem.

 •       Archive entries can have pathnames that include .. components.
         By default, tar will not extract files containing .. components
         in their pathname.

 •       Archive entries can exploit symbolic links to restore files to
         other directories.  An archive can restore a symbolic link to
         another directory, then use that link to restore a file into that
         directory.  To guard against this, tar checks each extracted path
         for symlinks.  If the final path element is a symlink, it will be
         removed and replaced with the archive entry.  If -U is specified,
         any intermediate symlink will also be unconditionally removed.
         If neither -U nor -P is specified, tar will refuse to extract the
         entry.
 To protect yourself, you should be wary of any archives that come from
 untrusted sources.  You should examine the contents of an archive with
       tar -tf filename
 before extraction.  You should use the -k option to ensure that tar will
 not overwrite any existing files or the -U option to remove any pre-
 existing files.  You should generally not extract archives while running
 with super-user privileges.  Note that the -P option to tar disables the
 security checks above and allows you to extract an archive while
 preserving any absolute pathnames, .. components, or symlinks to other
 directories.

SEE ALSO
bzip2(1), compress(1), cpio(1), gzip(1), pax(1), shar(1), xz(1),
libarchive(3), libarchive-formats(5), tar(5)

STANDARDS
There is no current POSIX standard for the tar command; it appeared in
ISO/IEC 9945-1:1996 (“POSIX.1”) but was dropped from IEEE Std 1003.1-2001
(“POSIX.1”). The options supported by this implementation were developed
by surveying a number of existing tar implementations as well as the old
POSIX specification for tar and the current POSIX specification for pax.

 The ustar and pax interchange file formats are defined by IEEE Std
 1003.1-2001 (“POSIX.1”) for the pax command.

HISTORY
A tar command appeared in Seventh Edition Unix, which was released in
January, 1979. There have been numerous other implementations, many of
which extended the file format. John Gilmore’s pdtar public-domain
implementation (circa November, 1987) was quite influential, and formed
the basis of GNU tar. GNU tar was included as the standard system tar in
FreeBSD beginning with FreeBSD 1.0.

 This is a complete re-implementation based on the libarchive(3) library.
 It was first released with FreeBSD 5.4 in May, 2005.

BUGS
This program follows ISO/IEC 9945-1:1996 (“POSIX.1”) for the definition
of the -l option. Note that GNU tar prior to version 1.15 treated -l as
a synonym for the –one-file-system option.

 The -C dir option may differ from historic implementations.

 All archive output is written in correctly-sized blocks, even if the
 output is being compressed.  Whether or not the last output block is
 padded to a full block size varies depending on the format and the output
 device.  For tar and cpio formats, the last block of output is padded to
 a full block size if the output is being written to standard output or to
 a character or block device such as a tape drive.  If the output is being
 written to a regular file, the last block will not be padded.  Many
 compressors, including gzip(1) and bzip2(1), complain about the null
 padding when decompressing an archive created by tar, although they still
 extract it correctly.

 The compression and decompression is implemented internally, so there may
 be insignificant differences between the compressed output generated by
       tar -czf - file
 and that generated by
       tar -cf - file | gzip

 The default should be to read and write archives to the standard I/O
 paths, but tradition (and POSIX) dictates otherwise.

 The r and u modes require that the archive be uncompressed and located in
 a regular file on disk.  Other archives can be modified using c mode with
 the @archive-file extension.

 To archive a file called @foo or -foo you must specify it as ./@foo or
 ./-foo, respectively.

 In create mode, a leading ./ is always removed.  A leading / is stripped
 unless the -P option is specified.

 There needs to be better support for file selection on both create and
 extract.

 There is not yet any support for multi-volume archives.

 Converting between dissimilar archive formats (such as tar and cpio)
 using the @- convention can cause hard link information to be lost.
 (This is a consequence of the incompatible ways that different archive
 formats store hardlink information.)

上述manual来自macOS 14.2,创建于January 31, 2020。

使用rar

macOS的tar命令似乎无法正确地解压rar文件,需要安装app或者使用rar的命令行工具。因为windows上常用rar,所以也使用homebrew安装了rar: brew install --cask rar

用法和tar类似:

  • 首先cd到压缩文件所在文件夹
  • 使用最常用的rar x yourfile.rar解压文件。

Manual for rar:

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 can contain the following string:

switches=

For example:

switches=-m5 -s

It is also possible to specify separate switch sets for individual
RAR commands using the following syntax:

switches_=

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 MB 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 switch -ilog is specified in the command line or configuration file,
 RAR will write informational messages about errors encountered while
 processing archives into a log file. Read the 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 is a single character or string specifying an action to be
   performed by RAR. Switches are designed to modify the way RAR performs
   such action. Other parameters are archive name and files to be archived
   or extracted.

   Listfiles are plain text files containing names of files to process.
   File names must start at the first column. It is possible to
   put comments to the listfile after // characters. For example,
   you can 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 can 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.

   path_to_extract includes the destination directory name followed by
   a path separator character. For example, it can be c:\dest\ in Windows
   or data/ in Unix. It specifies the directory to place extracted files
   in 'x' and 'e' commands. This directory is created by RAR if it does not
   exist yet. Alternatively it can be set with -op<path> switch.

   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 path separator, 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 the trailing path separator,
           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 no switches are
           specified, 'ch' command just copies the archive data without
           modification.

           If used with -amr switch to restore the saved archive name
           and time, other archive modification switches are ignored.

           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. If this command removes all files
           from archive, the empty archive is 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' directory
           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, UTF-8, UTF-16 and OEM (Windows only)
                 character tables;

           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.
   
           RAR cannot modify locked archives, so locking important archives
           prevents their accidental modification by RAR. Such protection
           might be especially useful in case of RAR commands processing
           archives in groups.

           This command is not intended or able to prevent modification
           by other tools or willful third party. It implements a safety
           measure only for accidental data change by RAR.

           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.

           Send unpacked file data to stdout. Informational messages
           are suppressed with this command, so they are not mixed
           with file data.

   
   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  .rar or .rev
           volume as the archive name.

           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 the data recovery record. 
   
           Recovery record is the data area, optionally added to archive
           and containing error correction codes, namely Reed-Solomon codes
           for RAR 5.0 archive format. 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 recovery can be done with 'R' repair command.

           Optional 'N' parameter defines the recovery record size
           as a percent of archive size. If it is omitted, 3% is assumed.
           Maximum allowed recovery record size is 1000%. Larger recovery
           records are processed slower both when creating and repairing.
           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.

           In case of a single continuous damage, typically it is possible
           to restore slightly less data than recovery record size.
           Recoverable data size can be lower for multiple damages.

           If a recovery record is partially broken, its remaining valid data
           still can be utilized to repair files. Repair command does not
           fix broken blocks in recovery record itself, only file data
           is corrected. After successful archive repair, you may need to
           create a new recovery record for rescued files.

           While the recovery record improves chances to repair damaged
           archives, it does not guarantee the successful recovery.
           Consider combining the recovery record feature with making
           multiple archive copies to different media for important data.

           Example:

           rar rr5 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 65535.

           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. It must not be larger than tenfold amount
           of RAR volumes. Values exceeding the threshold are adjusted
           automatically.

           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

           If <N> parameter is omitted, it is set to 10%.

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

           Windows version uses default32.sfx name for 32-bit SFX module.

   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.
           Same as none or illegal command line option are 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[1,2]
           Alternate destination path.

           This option may be useful when unpacking a group of archives.

           Switches -ad and -ad1 create a separate directory for files
           unpacked from each archive. These separate directories are
           created in destination directory for -ad and in each archive's
           directory for -ad1.

           Switch -ad2 places unpacked files directly to each archive's
           directory. Separate directories are not created.

           Destination directory parameter is ignored for -ad1 and -ad2
           switches.

           Examples:

           1) rar x -ad *.rar data\

              RAR will create subdirectories below 'data'
              for every unpacking archive.

           2) rar x -r -ad1 arc\*.rar

              RAR will recursively scan 'arc' directory for *.rar archives
              and create subdirectories in each archive's directory.


   -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 (first two 'M' after hours treated as minutes)
           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.

           If the first character in the format string is 'F', the rest of
           string specifies the default format string for -ag switch.
           Such -agf<default_format> switch has a practical value only
           if placed to rar.ini configuration file or RAR environment
           variable. For example, if we set RAR environment variable to
           -agfYYYY-MMM-DD, we can use -ag without a parameter with 
           YYYY-MMM-DD format string assumed.

           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 other file permissions.


   -am[s,r]
           Archive name and time [save, restore]

           Switch -ams preserves the archive metadata, which includes
           the original archive name and creation time. It can be used
           with archive modification commands, such as 'a' or 'ch'.
           Saved metadata is displayed in header of 'l' and 'v' archive
           list commands.

           If used together with -tk or -tl switches, -ams saves
           the archive modification time set by these switches.

           Switch -amr renames an archive to saved name. Also it sets
           the stored time as the archive creation and modification time
           in Windows and as the archive modification time in Unix.
           It can be used together with 'ch' command only, which ignores
           all other archive modification switches if -amr is specified.

           Switch -am without 's' and 'r' modifiers is treated as -ams.


           Examples:

           1) create files.rar and save its metadata

              rar a -am files.rar

           2) restore the original name of myfiles.rar

              rar ch -amr myfiles.rar


   -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<path>
           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 archive and 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.


   -ep     Exclude paths from names. This switch enables files to be
           added to an archive without including the path information.
           This could result in multiple files with the same name
           existing in the archive.

           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.

           If you use -ep3 when extracting, it will change
           underscores back to colons and create unpacked files
           in their original directories and disks. If the user
           also specified a destination path, it will be ignored.

           It also converts UNC paths from \\server\share to
           __server\share when archiving and restores them to
           the original state when extracting.

           This switch can help to backup several disks to the same
           archive. For example, you may run:

           rar a -ep3 -r backup.rar c:\ d:\ e:\

           to create backup and:

           rar x -ep3 backup.rar

           to restore it.

           But be cautious and use -ep3 only if you are sure that
           extracting archive does not contain any malicious files.
           In other words, use it if you have created an archive yourself
           or completely trust its author. This switch allows to overwrite
           any file in any location on your computer including important
           system files and should normally be used only for the purpose
           of backup and restore.

   
   -ep4<path>
           Exclude the path prefix from names.

           If this switch is used when archiving, the specified path
           is excluded from archived names if it is found in the beginning
           of such name, but does not match the entire name. Comparison
           is performed with names already prepared to store in archive,
           with removed drive letters and leading path separators.

           For example:

           rar a -ep4texts\books archive c:\texts\books\technical

           removes "text\books" from archived names, so they start
           from 'technical'. Since comparison is performed with names,
           as they are stored in archive, we can't use -ep4c:\texts\books.

           If this switch is used when extracting, it works similarly to
           -ap<path> switch. Path is removed if it is present
           in the beginning of archived file name. For example:

           rar x -ep4texts\books archive

           removes 'texts\books' from those archived paths,
           which start from it.


   -e[+]<attr>
           Specifies file exclude or include attributes mask.

           <attr> is a number in the decimal, octal (with leading '0')
           or hex (with leading '0x') format.

           By default, without '+' sign before <attr>, this switch
           defines the exclude mask. So if result of bitwise AND between
           <attr> and file attributes is nonzero, file would not be
           processed.

           If '+' sign is present, it specifies the include mask.
           Only those files which have at least one attribute specified
           in the mask will be processed.

           In Windows version is also possible to use symbols D, S, H,
           A and R instead of a digital mask to denote directories
           and files with system, hidden, archive and read-only attributes.
           The order in which the attributes are given is not significant.
           Unix version supports D and V symbols to define directory
           and device attributes.

           It is allowed to specify both -e<attr> and -e+<attr>
           in the same command line.

           Examples:

           1) archive only directory names without their contents

              rar a -r -e+d dirs

           2) do not compress system and hidden files:

              rar a -esh files

           3) do not extract read-only files:

              rar x -er files


   -f      Freshen files. May be used with archive extraction or creation.
           The command string "a -f" is equivalent to the command 'f', you
           could also use the switch '-f' with the commands 'm' or 'mf'. If
           the switch '-f' is used with the commands 'x' or 'e', then only
           old files would be replaced with new versions extracted from the
           archive.


   -hp[p]  Encrypt both file data and headers.

           This switch is similar to -p[pwd], but switch -p encrypts
           only file data and leaves other information like file names
           visible. This switch encrypts all sensitive archive areas
           including file data, file names, sizes, attributes, comments
           and other blocks, so it provides a higher security level.
           Without a password it is impossible to view even the list of
           files in archive encrypted with -hp.

           Example:

           rar a -hpfGzq5yKw secret report.txt

           will add the file report.txt to the encrypted archive
           secret.rar using the password 'fGzq5yKw'


   -ht[b|c]
           Select hash type [BLAKE2,CRC32] for file checksum.

           File data integrity in RAR archive is protected by checksums
           calculated and stored for every archived file.

           By default, RAR uses CRC32 function to calculate the checksum.
           RAR 5.0 archive format also allows to select BLAKE2sp hash
           function instead of CRC32.

           Specify -htb switch for BLAKE2sp and -htc for CRC32 hash function.
           Since CRC32 is the default algorithm, you may need -htc only to
           override -htb in RAR configuration.

           CRC32 output is 32 bit length. While CRC32 properties are
           suitable to detect most of unintentional data errors,
           it is not reliable enough to verify file data identity.
           In other words, if two files have the same CRC32,
           it does not guarantee that file contents is the same.

           BLAKE2sp output is 256 bit. Being a cryptographically strong
           hash function, it practically guarantees that if two files
           have the same value of BLAKE2sp, their contents is the same.
           BLAKE2sp error detection property is also more reliable than
           in shorter CRC32.
           
           Since BLAKE2sp output is longer, resulting archive is
           slightly larger for -htb switch.

           If archive headers are unencrypted (no switch -hp), checksums
           for encrypted RAR 5.0 files are modified using a special
           password dependent algorithm, to make impossible guessing
           file contents based on checksums. Do not expect such encrypted
           file checksums to match usual CRC32 and BLAKE2sp values.
           
           This switch is supported only by RAR 5.0 format.

           You can see checksums of archived files using 'vt' or 'lt'
           commands.
   

           Example:

           rar a -htb lists.rar *.lst

           will add *.lst to lists.rar using BLAKE2sp for file checksums.


   -id[c,d,n,p,q]
           Display or disable messages.

           Switch -idc disables the copyright string.

           Switch -idd disables "Done" string at the end of operation.

           Switch -idn disables archived names output when creating,
           testing or extracting an archive. It disables directory creation
           messages when unpacking a file to non-existing directory.
           It can affect some other archive processing commands as well.
           It does not hide other messages and total percentage indicator.
           Minor visual artifacts, such as percentage indicator overwriting
           few last characters of error messages, are possible with -idn.

           Switch -idp disables the percentage indicator.

           Switch -idq turns on the quiet mode, so only error messages
           and questions are displayed.

           It is allowed to use several modifiers at once,
           so switch -idcdp is correct.


   -ieml[.][addr]
           Send archive by email. Windows version only.

           Attach an archive created or updated by the add command
           to email message. You need to have a MAPI compliant email
           client to use this switch (most modern email programs
           support MAPI interface).

           You may enter a destination email address directly
           in the switch or leave it blank. In the latter case you
           will be asked for it by your email program. It is possible
           to specify several addresses separated by commas or semicolons.

           If you append a dot character to -ieml, an archive will be
           deleted after it was successfully attached to an email.
           If the switch is used when creating a multivolume archive,
           every volume is attached to a separate email message.


   -ierr   Send all messages to stderr.


   -ilog[name]
           Log errors to file.

           Write error messages to rar.log file. If optional 'name'
           parameter is not specified, the log file is created
           using the following defaults:

           Unix:    .rarlog file in the user's home directory;
           Windows: rar.log file in %APPDATA%\WinRAR directory.

           If 'name' parameter includes a file name without path,
           RAR will create the log file in the default directory
           mentioned above using the specified name. Include both path
           and name to 'name' parameter if you wish to change
           the location of log file.

           By default, log file uses UTF-16 little endian encoding,
           but it can be changed with -sc<charset>g switch, such as -scag
           for native single byte encoding.


           Example:

           rar a -ilogc:\log\backup.log backup d:\docs

           will create c:\log\backup.log log file in case of errors.


   -inul   Disable all messages.


   -ioff[n]
           Turn PC off after completing an operation.

           Use -ioff or -ioff1 to turn PC off, -ioff2 to hibernate,
           -ioff3 to sleep and -ioff4 to restart. Appropriate power features
           must be supported by operating system.

           If several RAR copies are started with this switch,
           PC is turned off by a copy finished last.
           
           Windows version only.


   -isnd[-]
           Control notification sounds.

           Use -isnd to enable notification sounds and -isnd- to disable them.


   -iver   Display the version number and quit. You can run just "RAR -iver".


   -k      Lock archive.
   
           Prevents accidental archive modification by RAR.
           See the 'k' command description for details.

           Example:

           rar a -k final.rar srcfiles


   -kb     Keep broken extracted files.

           RAR, by default, deletes files with checksum errors
           after extraction. The switch -kb specifies that files
           with checksum errors should not be deleted.


   -log[fmt][=name]
           Write names to log file.

           This switch allows to write archive and file names to specified
           text file in archiving, extracting, deleting and listing commands.
           Its behavior is defined by 'fmt' string, which can include one
           or more of following characters:

           A - write archive names to log file. If RAR creates or processes
               volumes, all volume names are logged.

           F - write processed file names to log file. It includes
               files added to archive and extracted, deleted or listed
               files inside of archive.

           P - if log file with specified name exists, append data
               to existing file instead of creating a new one.

           U - write data in Unicode format.

           If neither 'A' nor 'F' are specified, 'A' is assumed.

           'name' parameter allows to specify the name of log file.
           It must be separated from 'fmt' string by '=' character.
           If 'name' is not present, RAR will use the default rarinfo.log
           file name.

           It is allowed to specify several -log switches in the same
           command line.

           This switch can be particularly useful, when you need to process
           an archive created with -ag or -v switches in a batch script.
           You can specify -loga=arcname.txt when creating an archive
           and then read an archive name generated by RAR from arcname.txt
           with an appropriate command. For example, in Windows batch file
           it can be: set /p name=<arcname.txt.

           Examples:

           1) write names of created volumes to vollist.txt:

              rar a -v100m -loga=vollist.txt volume.rar c:\data

           2) write the generated archive name to backup.txt in Unicode:

              rar a -ag -logau=backup.txt backup.rar myfiles\*

           3) write names of tested volumes to vollist.txt and names
              of tested archived files inside of volumes to filelist.txt:

              rar t -log=vollist.txt -logf=filelist.txt volume.part01.rar


   -m<n>   Set compression method:

      -m0   store     do not compress file when adding to archive
      -m1   fastest   use fastest method (less compressive)
      -m2   fast      use fast compression method
      -m3   normal    use normal (default) compression method
      -m4   good      use good compression method (more
                      compressive, but slower)
      -m5   best      use best compression method (slightly more
                      compressive, but slowest)

           If this switch is not specified, RAR uses -m3 method
           (normal compression).


   -mc<par>
           Set advanced compression parameters.

           Improper use of this switch may lead to suboptimal performance
           and compression. This switch has the following syntax:

           -mc[channels][mode][+ or -]

           where <mode> is the single character field defining
           the compression algorithm to be configured.

           Possible <mode> values are:

             D       - delta compression;
             E       - x86 executable compression;
             L       - long range search;
             X       - exhaustive search.

           '+' sign at the end of switch applies the selected algorithm
           to all processed data, '-' disables it completely.
           If no sign is specified, RAR chooses modes automatically,
           based on data and current compression method.
           Switch -mc- disables all modes.

           <Channels> parameter is used by delta compression and ignored
           by other modes. Available modes are described below.


           Delta compression

           Splits data to several single byte channels and calculates
           the difference between them. Can improve the compression ratio
           of table data. <Channels> is the number of byte channels
           from 1 to 31.


           x86 executable compression

           Can improve the compression ratio of 32 and 64 bit x86 executables.


           Long range search

           Enables the search algorithm designed to efficiently locate
           longer and more distant repeated data blocks. It can helps to
           improve the compression ratio and sometimes speed for redundant
           data like big text files. This algorithm increases memory
           requirements when archiving, but doesn't affect extraction
           memory requirements or speed.
           
           If neither -mcl+ nor -mcl- are specified, RAR applies the long
           range search depending on the compression method, dictionary size
           and other parameters. This algorithm is required and enabled
           automatically for dictionaries exceeding 4 GB, where it can't be
           turned off with -mcl- switch.
           
           Long range search mode is applicable to -m2..-m5 compression
           methods and ignored for -m1.


           Exhaustive search

           Enables much slower and more exhaustive repeated data search
           and compression algorithm. It might provide the additional
           compression gain on some types of redundant data, but at much
           lower speed. Long range search is needed to implement this mode
           efficiently, so -mcx activates it automatically.


           Example:

           RAR a -s -md1g -mcx texts *.txt

           create a solid archive with 1 GB dictionary and exhaustive search.


   -md[x]<size>[k,m,g]
           Select the dictionary size.

           Sliding dictionary is the memory area used by compression
           algorithm to find and compress repeated data patterns. 
           If size of file to compress, or total files size in case
           of solid archive, is larger than dictionary size, increasing
           the dictionary is likely to increase the compression ratio,
           reduce the archiving speed and increase memory requirements.

           For RAR 5.0 archive format the dictionary size can be:
           128 KB, 256 KB, 512 KB, 1 MB, 2 MB, 4 MB, 8 MB, 16 MB,
           32 MB, 64 MB, 128 MB, 256 MB, 512 MB, 1 GB, 2 GB, 4 GB.

           RAR 7.0 extends the maximum dictionary size up to 64 GB
           and permits not power of 2 sizes for dictionaries exceeding 4 GB.
           Such archives can be unpacked by RAR 7.0 and newer.

           By default, RAR refuses to unpack archives with dictionary
           exceeding 4 GB. It is done to prevent the unexpected large memory
           allocation. Use -md<size> or -mdx<size> to allow unpacking
           dictionaries up to and including the specified size.
           Unlike -md<size>, -mdx<size> is applied to extraction only
           and can be added to RAR environment variable, not affecting
           archiving commands.

           'k', 'm' and 'g' modifiers placed after the size, set kilobyte,
           megabyte and gigabyte units, like -md64m for 64 MB dictionary.
           If no modifier is present, megabytes are assumed for -md<size>
           and gigabytes for -mdx<size> switch, so -md64m and -md64
           or -mdx8 and -mdx8g are equal.

           Compression memory requirements vary depending on the dictionary
           size and presence of long range search -mcl switch.
           Rough estimate is 7x of dictionary size for 1 GB and 1.5x
           for 64 GB dictionary.

           When extracting, slightly more than a single dictionary size
           is allocated.

           If size of all source files for solid archive or size of largest
           source file for non-solid archive is at least twice less than
           dictionary size, RAR can reduce the dictionary size. It helps
           to lower memory usage without decreasing compression.

           Default sliding dictionary size is 32 MB.

           Example:

           RAR a -s -md128 lib *.dll

           create a solid archive in RAR 5.0 format with 128 MB dictionary.


   -me[par]
           Set encryption parameters.

           Now only "s" parameter is supported. You can use -mes switch
           to skip encrypted files when extracting or testing.


   -ms[list]
           Specify file types to store.

           Specify file types, which will be stored without compression.
           This switch may be used to store already compressed files,
           which helps to increase archiving speed without noticeable
           loss in the compression ratio.

           Optional <list> parameter defines the list of file extensions
           separated by semicolons. For example, -msrar;zip;jpg will
           force RAR to store without compression all RAR and ZIP
           archives and JPG images. It is also allowed to specify wildcard
           file masks in the list, so -ms*.rar;*.zip;*.jpg will work too.
           Several -ms switches are permitted, such as -msrar -mszip
           instead of -msrar;zip.

           In Unix -ms switch containing several file types needs to be
           enclosed in quote marks. It protects semicolons from processing
           by Unix shell. Another solution is to use individual -ms<type>
           switches for every file type.

           If <list> is not specified, -ms switch will use the default
           set of extensions, which includes the following file types:

           7z, ace, arj, bz2, cab, gz, jpeg, jpg, lha, lz, lzh, mp3,
           rar, taz, tbz2, tgz, txz, zst, xz, z, zip, zipx, tzst


   -mt<threads>
           Set the number of threads.

           <threads> parameter can take values from 1 to 64.
           It defines the recommended maximum number of active threads
           for compression algorithm also as for other RAR modules,
           which can start several threads. While RAR attempts to follow
           this recommendation, sometimes the real number of active
           threads can exceed the specified value.

           Change of <threads> parameter slightly affects the compression
           ratio, so archives created with different -mt switches
           will not be exactly the same even if all other compression
           settings are equal.

           If -mt switch is not specified, RAR will try to detect
           the number of available processors and select the optimal
           number of threads automatically.
   

   -n<f>   Additionally filter included files.

           Apply the mask as an additional filter to included file list.
           Wildcards can be used both in the name and file parts of
           file mask. See switch -x description for details on mask syntax.
           You can specify the switch '-n' several times.

           This switch does not replace usual file masks, which still
           need to be entered in the command line. It is an additional
           filter limiting processed files only to those matching
           the include mask specified in -n switch. It can help to
           reduce the command line length sometimes.

           For example, if you need to compress all *.txt and *.lst
           files in directories Project and Info, you can enter:

           rar a -r text Project\*.txt Project\*.lst Info\*.txt Info\*.lst

           or using the switch -n:

           rar a -r -n*.txt -n*.lst text Project Info


   -n@<lf> Read additional filter masks from list file.

           Similar to -n<f> switch, but reads filter masks from
           the list file. If you use -n@ without the list file name
           parameter, it will read filter masks from stdin.

           This switch does not replace usual list files or file masks,
           which still need to be entered in the command line.
           It is an additional filter limiting processed files only to
           those matching the include mask specified in -n switch.

           Example:

           rar a -r -n@inclist.txt text Project Info @listfile.txt


   -oc     Set NTFS Compressed attribute. Windows version only.

           This switch allows to restore NTFS Compressed attribute
           when extracting files. RAR saves Compressed file attribute
           when creating an archive, but does not restore it unless
           -oc switch is specified.

   -oh     Save hard links as the link instead of the file.

           If archiving files include several hard links, store the first
           archived hard link as usual file and the rest of hard links
           in the same set as links to this first file. When extracting
           such files, RAR will create hard links instead of usual files.

           You must not delete or rename the first hard link in archive
           after the archive was created, because it will make extraction
           of following links impossible. If you modify the first link,
           all following links will also have the modified contents
           after extracting. Extraction command must involve the first
           hard link to create following hard links successfully.
   
           This switch is supported only by RAR 5.0 format.


   -oi[0-4][:<minsize>]
           Save identical files as references.

           Switch -oi0 (or just -oi-) turns off identical file processing,
           so such files are compressed as usual files. It can be used to
           override another -oi value stored in RAR configuration.

           If -oi1 (or just -oi) is specified, RAR analyzes the file
           contents before starting archiving. If several identical files
           are found, the first file in the set is saved as usual file
           and all following files are saved as references to this first
           file. It allows to reduce the archive size, but applies some
           restrictions to resulting archive. You must not delete or rename
           the first identical file in archive after the archive was
           created, because it will make extraction of following files
           using it as a reference impossible. If you modify the first file,
           following files will also have the modified contents
           after extracting.
           
           While typically it is possible to unpack a reference without
           unpacking the first file, in some cases it might be necessary
           to involve the first file into extraction to create following
           files successfully. Such cases include a multivolume archive
           stored on several removable media and archives containing
           a very large number of references.

           It is recommended to use -oi only if you compress a lot of
           identical files and will not modify an archive later.
           If all identical files are small enough to fit into
           compression dictionary specified with -md<n> switch,
           switch -s can provide more flexible solution than -oi.

           Switch -oi2 is similar to -oi1, with the only difference:
           it will display names of found identical files before starting
           archiving.

           Switches -oi3 and -oi4 allow to utilize RAR to generate
           lists of identical files. Though you still need to provide
           a dummy archive name to make the command syntax valid,
           in this mode an archive is not created and nothing is compressed.
           If -oi3 is used, file sizes and names are displayed
           and every identical file group is separated with empty line.
           Switch -oi4 displays bare file names and skips the first
           identical file in every file group, so only duplicates
           are listed.

           Optional <minsize> value allows to define the minimum file size
           threshold. Files smaller than <minsize> are not analyzed
           and not considered as identical. If this parameter is not
           present, it is assumed to be 64 KB by default. Selecting
           too small <minsize> may increase the time required to detect
           identical files.
   
           Switches -oi1 and -oi2 are supported only by RAR 5.0 format.

           Examples:

           1) rar a -oi archive

           Save contents of current directory to archive.rar.
           Store identical files as references.

           2) rar a -oi3:1000000 -r dummy c:\photo\*.jpg

           List all duplicate *.jpg files, larger than or equal to
           1000000 bytes, found in c:\photo and its subdirectories.
   

   -ol[a,-]
           Process symbolic links as the link [absolute paths, skip]
           
           Save symbolic links as links, so file or directory contents
           is not archived. In Windows version it also saves reparse points
           as links. Such archive entries are restored as symbolic links
           or reparse points when extracting.

           Supported both in Unix and Windows RAR versions.

           In Windows you may need to run RAR as administrator to create
           symbolic links when extracting.

           RAR adds all links regardless of target when archiving with
           -ol switch. When extracting, to prevent placing files outside
           of destination directory RAR can skip symbolic links with
           absolute paths, the excessive number of ".." in link target
           or other potentially dangerous link parameters. Also it can
           convert some of links to directories. You can turn off these
           security checks and extract all links as is with -ola switch.

           Placing files outside of destination directory can present
           a security risk when extracting. Use -ola switch only if you
           are sure that archive contents is safe, such as your own backup.

           Links that are considered safe by RAR are extracted always
           regardless of -ol or -ola switch, unless -ol- is specified.

           Switch -ol- skips symbolic links when archiving or extracting.


   -oni    Allow potentially incompatible names.

           While NTFS file system permits file names with trailing spaces
           and dots, also as reserved device names, a lot of Windows
           programs fail to process such names correctly. If this switch
           is not specified, RAR removes trailing spaces and dots, if any, 
           from file names when extracting. It also inserts the underscore
           character in the beginning of reserved device names, such as aux.

           Specify this switch if you need to extract such names as is.
           It might be associated with compatibility or even security risks.

           Windows version only.

   -op<path>
           Set the output path.

           Specify the directory to place extracted files in 'x' and 'e'
           commands. This directory is created by RAR if it does not
           exist yet.

           Unlike <path_to_extract\> command line parameter, -op switch
           also accepts paths without trailing path separator character.

           Example:

           rar x -opdest archive

           unpacks contents of archive.rar to 'dest' directory.


   -or     Rename extracted files automatically if file with the same name
           already exists. Renamed file will get the name like
           'filename(N).txt', where 'filename.txt' is the original file
           name and 'N' is a number starting from 1 and incrementing
           if file exists.


   -os     Save NTFS streams. Windows version only.

           This switch has meaning only for NTFS file system and allows
           to save alternate data streams associated with a file.
           You may need to specify it when archiving if you use software
           storing data in alternative streams and wish to preserve
           these streams.

           Streams are not saved for NTFS encrypted files.

           Unlike GUI WinRAR, the console RAR doesn't propagate the archive
           Mark of the Web stream to extracted files. It unpacks archived
           Zone.Identifier streams as is, regardless of host archive
           Zone.Identifier stream presence.


   -ow     Use this switch when archiving to save file security
           information and when extracting to restore it.

           Unix RAR version saves file owner and group when using
           this switch.

           Windows version stores owner, group, file permissions and
           audit information, but only if you have necessary privileges
           to read them. Note that only NTFS file system supports
           file based security under Windows.


   -o[+|-] Set the overwrite mode. Can be used both when extracting
           and updating archived files. Following modes are available:

             -o           Ask before overwrite
                          (default for extracting files);

             -o+          Overwrite all
                          (default for updating archived files);

             -o-          Skip existing files.


   -p[pwd] Set password

           Set password <pwd> to encrypt files when archiving
           or to decrypt when extracting.

           Passwords are case-sensitive. Maximum password length is
           127 characters. Longer passwords are truncated to this length.
           If you omit a password in command line, you will be prompted
           with "Enter password" message. You can also use file redirection
           or pipe to specify a password if <pwd> parameter is missing.

           Examples:

           1) rar a -psecret texts.rar *.txt

           add files *.txt and encrypt them with password "secret".

           2) rar -p texts.rar *.txt < psw.txt

           set contents of psw.txt file as a password.


   -qo[-|+]
           Add quick open information [none|force]

           RAR archives store every file header containing information
           such as file name, time, size and attributes immediately
           before data of described file. This approach is more damage
           resistant than storing all file headers in a single continuous
           block, which if broken or truncated would destroy the entire
           archive contents. But while being more reliable, such file
           headers scattered around the entire archive are slower to
           access if we need to quickly open the archive contents 
           in a shell like WinRAR graphical interface.

           To improve archive open speed and still not make the entire
           archive dependent on a single damaged block, RAR 5.0 archives
           can include an optional quick open record. Such record is
           added to the end of archive and contains copies of file names
           and other file information stored in a single continuous block
           additionally to normal file headers inside of archive.
           Since the block is continuous, its contents can be read quickly,
           without necessity to perform a lot of disk seek operations.
           Every file header in this block is protected with a checksum.
           If RAR detects that quick open information is damaged,
           it resorts to reading individual headers from inside of archive,
           so damage resistance is not lessened.

           Quick open record contains the full copy of file header,
           which may be several tens or hundreds of bytes per file,
           increasing the archive size by the same amount. This size
           increase is most noticeable for many small files, when file
           data size is comparable to file header. So by default,
           if no -qo is specified or -qo without parameter is used,
           RAR stores copies of headers only for relatively large files
           and continues to use local headers for smaller files.
           Concrete file size threshold can depend on RAR version.
           Such approach provides a reasonable open speed to archive size
           tradeoff. If you prefer to have the maximum archive open speed
           regardless of size, you can use -qo+ to store copies of all
           file headers. If you need to have the smallest possible archive
           and do not care about archive open speed in different programs,
           specify -qo- to exclude the quick open information completely.

           Switch -qo- also prohibits access to quick open information
           in existing archives, such as when extracting or listing
           their contents.

           If you wish to measure the performance effect of this switch,
           be sure that archive contents is not stored in a disk cache.
           No real disk seeks are performed for cached archive file,
           making access to file headers fast even without quick open
           record.

   
   -r      Recurse subdirectories. May be used with commands:
           a, u, f, m, x, e, t, p, v, l, c, cf and s.

           When used with the commands 'a', 'u', 'f', 'm' will process
           files in all sub-directories as well as the current working
           directory.

           When used with the commands x, e, t, p, v, l, c, cf or s will
           process all archives in sub-directories as well as the current
           working directory.


   -r-     Disable recursion.

           Even without -r switch RAR can enable the recursion
           automatically in some situations. Switch -r- prohibits it.

           If you specify a directory name when archiving and if such
           name does not include wildcards, by default RAR adds
           the directory contents even if switch -r is not specified.
           Also RAR automatically enables the recursion if disk root
           without wildcards is specified as a file mask. Switch -r-
           disables such behavior.

           For example:

           rar a -r- arc dirname

           command will add only the empty 'dirname' directory and ignore
           its contents. Following command:

           rar a -r- arc c:\

           will compress contents of root c: directory only and
           will not recurse into subdirectories.


   -r0     Similar to -r, but when used with the commands 'a', 'u', 'f',
           'm' will recurse into subdirectories only for those file masks,
           which include wildcard characters '*' and '?'.

           This switch works only for file names. Directory names without
           a file name part, such as 'dirname', are not affected by -r0
           and their contents is added to archive completely unless -r-
           switch is specified.

           Example:

           rar a -r0 docs.rar *.doc readme.txt

           add *.doc files from the current directory and its subdirectories
           and readme.txt only from the current directory to docs.rar
           archive. In case of usual -r switch, RAR would search for
           readme.txt in subdirectories too.


   -ri<p>[:<s>]
           Set priority and sleep time. Available only in RAR for Windows.
           This switch regulates system load by RAR in multitasking
           environment. Possible task priority <p> values are 0 - 15.

           If <p> is 0, RAR uses the default task priority.
           <p> equal to 1 sets the lowest possible priority,
           15 - the highest possible.

           Sleep time <s> is a value from 0 to 1000 (milliseconds).
           This is a period of time that RAR gives back to the system
           after read or write operations while compressing or extracting.
           Non-zero <s> may be useful if you need to reduce system load
           even more than can be achieved with <p> parameter.

           Example:

           execute RAR with default priority and 10 ms sleep time:

           rar a -ri0:10 backup *.*


   -rr[N]  Add the data recovery record. This switch is used when creating
           or modifying an archive to add the data recovery record to
           archive. See 'rr[N]' command description for details.


   -rv[N]  Create recovery volumes. This switch is used when creating
           a multivolume archive to generate recovery volumes.
           See the 'rv[N]' command description for details.


   -s      Create solid archive. A solid archive is an archive packed by
           a special compression method, which treats several or all
           files, within the archive, as one continuous data stream.

           Solid archiving significantly increases compression, when
           adding a large number of small, similar files. But it also
           has a few important disadvantages: slower updating of existing
           solid archives, slower access to individual files, lower
           damage resistance.

           Usually files in a solid archive are sorted by extension.
           But it is possible to disable sorting with -ds switch or set
           an alternative file order using a special file, rarfiles.lst.

           Example:

           add all *.c and *.h files from the current directory to
           the solid archive sources.rar:

           rar a -s sources.rar *.c *.h


   -s<N>   Create solid groups using the file count

           Similar to -s, but resets solid statistics after compressing
           <N> files. Usually decreases compression, but also
           decreases losses in case of solid archive damages.


   -sc<charset>[objects]
           Specify the character set.

           'Charset' parameter is mandatory and can have one
           of the following values:

             U - Unicode UTF-16;
             F - Unicode UTF-8;
             A - the native single byte encoding, which is ANSI
                 for Windows version;
             O - OEM (DOS) encoding. Windows version only.

           Endianness of source UTF-16 files, such as list files
           or comments, is detected based on the byte order mark.
           If byte order mask is missing, little endian encoding is assumed.

           'Objects' parameter is optional and can have one of
           the following values:

             G - log files produced by -ilog switch;
             L - list files;
             C - comment files;
             R - messages sent to redirected files and pipes (Windows only). 

           It is allowed to specify more than one object, for example,
           -scolc. If 'objects' parameter is missing, 'charset' is applied
           to all objects.

           This switch allows to specify the character set for files
           in -z[file] switch, list files and comment files written by
           "cw" command.

           Examples:

           1) rar a -scol data @list

           Read names contained in 'list' using OEM encoding.

           2) rar c -scuc -zcomment.txt data

           Read comment.txt as Unicode file.

           3) rar cw -scuc data comment.txt

           Write comment.txt as Unicode file.

           4) rar lb -scur data > list.txt

           Save archived file names in data.rar to list.txt in Unicode.


   -se     Create solid groups using extension

           Similar to -s, but resets solid statistics if file extension
           is changed. Usually decreases compression, but also
           decreases losses from solid archive damages.


   -sfx[name]
           Create SFX archives. If this switch is used when creating a new
           archive, a Self-Extracting archive (using a module in file
           default.sfx or specified in the switch) would be created.
           In 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.

           Windows version uses default32.sfx name for 32-bit SFX module.

           Example:

           rar a -sfxwincon.sfx myinst

           create SelF-eXtracting (SFX) archive using wincon.sfx
           SFX-module.


   -si[name]
           Read data from stdin (standard input), when creating, extracting
           or testing an archive. 
           
           When archiving, the optional 'name' parameter allows to specify
           a file name of compressed stdin data in the created archive.
           If this parameter is missing, the name will be set to 'stdin'.

           When extracting, the archive name specified in the command line
           is used only in informational messages, but actual archive data
           is read from stdin. So any dummy archive name can be applied.
           
           RAR cannot perform operations requiring backward seeks
           when reading archive data from stdin. Incomplete list of
           features unavailable in such mode includes displaying archive
           comments, testing the recovery record, utilizing the quick open
           information, processing multivolume archives.

           Any prompts requiring user interaction are not allowed with
           -si and lead to program termination. If overwriting existing
           files or unpacking encrypted files is possible, avoid such
           prompts with -o[+|-|r], -p<pwd> or -mes switches.

           Examples:

           1) compress 'type readme.txt' output as 'readme.rar' file

           type readme.txt | rar a -sireadme.txt readme.rar

           2) unpack docs.rar to 'docs' directory

           type docs.rar | rar x -si -o+ -pmypwd dummy docs\


   -sl<size>[b|B|k|K|m|M|g|G|t|T]
           Process only those files, which size is less than
           specified in <size> parameter of this switch.

           Unit type character following the size value can be 'b' or 'B'
           for bytes, 'k' for kilobytes, 'K' for thousands of bytes,
           'm' for megabytes, 'M' for millions of bytes, 'g' for gigabytes,
           'G' for billions of bytes, 't' for terabytes, 'T' for trillions
           of bytes. If this character is not present, bytes are assumed.


   -sm<size>[b|B|k|K|m|M|g|G|t|T]
           Process only those files, which size is more than
           specified in <size> parameter of this switch.
           
           Unit type character following the size value can be 'b' or 'B'
           for bytes, 'k' for kilobytes, 'K' for thousands of bytes,
           'm' for megabytes, 'M' for millions of bytes, 'g' for gigabytes,
           'G' for billions of bytes, 't' for terabytes, 'T' for trillions
           of bytes. If this character is not present, bytes are assumed.


   -sv     Create independent solid volumes

           By default RAR tries to reset solid statistics as soon
           as possible when starting a new volume, but only
           if enough data was packed after a previous reset
           (at least a few megabytes).

           This switch forces RAR to ignore packed data size and attempt
           to reset statistics for volumes of any size. It decreases
           compression, but increases chances to extract a part of data
           if one of several solid volumes in a volume set was lost
           or damaged.

           Note that sometimes RAR cannot reset statistics even
           using this switch. For example, it cannot be done when
           compressing one large file split between several volumes.
           RAR is able to reset solid statistics only between separate
           files, but not inside of single file.

           Ignored if used when creating a non-volume archive.


   -sv-    Create dependent solid volumes

           Disables to reset solid statistics between volumes.

           It slightly increases compression, but significantly reduces
           chances to extract a part of data if one of several solid
           volumes in a volume set was lost or damaged.

           Ignored if used when creating a non-volume archive.


   -s-     Disable solid archiving


   -t      Test files after archiving. This switch is especially
           useful in combination with the move command, so files will be
           deleted only if the archive had been successfully tested.


   -ta[m,c,a,o]<date>
           Process only files modified after the specified date.
           Files matching the specified date exactly are also included.

           Format of the date string is YYYYMMDDHHMMSS.
           It is allowed to insert separators like '-' or ':' to
           the date string and omit trailing fields. For example,
           the following switch is correct: -ta2001-11-20
           Internally it will be expanded to -ta20011120000000
           and treated as "files modified after 0 hour 0 minutes
           0 seconds of 20 November 2001".

           Use 'm', 'c', 'a' modifiers to specify modification,
           creation (ctime in Unix) and last access time accordingly,
           such as -tac20011120 for creation time or ctime.
           If such modifier is omitted, the modification time is assumed.

           It is allowed to use several modifiers in the same switch,
           such as -tamc20190215, to set the same date for all specified
           times. Alternatively you can add several time filtering
           switches to command line. By default, time filters use AND logic,
           so a file must match all such filters to be processed.
           It can be changed to OR logic with 'o' modifier, so a file will
           have to match at least one 'o' filter. For example, use
           -taco20190201 -tamo20190210 to include files created after
           2019-02-01 or modified after 2019-02-10.


   -tb[m,c,a,o]<date>
           Process only files modified before the specified date.
           Files matching the specified date exactly are not included.

           Format of the switch is the same as -ta<date>.


   -tk     Keep original archive date. Prevents RAR from modifying the
           archive date when changing an archive.


   -tl     Set archive time to newest file. Forces RAR to set the date of a
           changed archive to the date of the newest file in the archive.


   -tn[m,c,a,o]<time>
           Process files newer than the specified time period.
           Files matching the specified time period exactly are also included.

           Format of the time string is:

           [<ndays>d][<nhours>h][<nminutes>m][<nseconds>s]

           For example, use switch -tn15d to process files newer
           than 15 days and -tn2h30m to process files newer than
           2 hours 30 minutes.

           Use 'm', 'c', 'a' modifiers to specify modification,
           creation (ctime in Unix) and last access time accordingly,
           such as -tnc2h30m for creation time or ctime.
           If such modifier is omitted, the modification time is assumed.

           It is allowed to use several modifiers in the same switch,
           such as -tnmc30d, to set the same period for all specified times.
           Alternatively you can add several time filtering switches to
           command line. By default, time filters use AND logic,
           so a file must match all such filters to be processed.
           It can be changed to OR logic with 'o' modifier, so a file
           will have to match at least one 'o' filter. For example,
           use -tnco30d -tnmo20d to include files with creation time
           newer than 30 days or modification time newer than 20 days.

   -to[m,c,a,o]<time>
           Process files older than the specified time period.
           Files matching the specified time period exactly are not included.

           Format of the switch is the same as -tn<time>.


   -ts[m,c,a,p][+,-,1]
           Save or restore file time (modification, creation or ctime,
           access, preserve).

           Use -tsm to save the file modification time. Switch -tsc saves
           the creation time in Windows and the change time, also known
           as ctime, in Unix. Switch -tsa saves the last access time.
           Multiple -ts switches, such as -tsc -tsa, are allowed.
           If 'm', 'c' or 'a' are not specified, all three file times
           are assumed.

           Append '+' to store a file time with maximum possible precision.
           The exact value depends on the particular operating system
           also as the file system and can be up to 100 nanoseconds
           in Windows and 1 nanosecond in Unix. Append '1' to set 1 second
           precision or '-' to not save a file time, such as -ts- to omit
           all 3 times. If '+', '-' or '1' are not present, '+' is assumed,
           so -ts+ and -ts both save all three high precision times.

           All stored times for same file always have the same precision.
           If different precisions are specified, such as -tsm1 -tsc+,
           common one is selected.

           If -ts switch is not specified, RAR stores the high precision
           modification time and omits two other times.

           By default RAR sets only the modification time for extracted files,
           even if archive contains other times. Use -ts or -ts+ when
           unpacking to set all three times, -tsc and -tsa to set
           creation (ctime in Unix) and last access times, -tsm- or -ts-
           to set the current system time instead of modification time
           stored in archive.

           Windows allows to set all three file times when unpacking.
           In Unix we can set the modification and last access, but not
           the change time.

           Use -tsp switch to preserve the original last access file time
           of source files when archiving. This switch attempts to keep
           the original last access time of archiving files, but it does not
           control which timestamps are to be stored in archive.
           It has to be combined with other -ts switches for this purpose.
           For example, if we wish to save the last access time to archive
           and preserve the last access time of source files, we need
           to use -tsa -tsp together. Switch -tsp can prevent opening
           some files, which can be opened without it.

           While -tsp is supported by RAR for Windows, it is not guaranteed
           to work for other platforms.

           It is allowed to combine several modifiers in the same switch,
           such as -tscap instead of -tsc -tsa -tsp.

           Examples:

           1) rar a -ts backup

           Store all file times with the highest possible precision.

           2) rar x -tsa backup

           Restore modification and last access time. Switch -tsm is not
           required, because RAR sets the modification time by default.
           If we wish to restore only the last access time, we should use
           -tsm- -tsa switches.

           3) rar a -tsm1 -tsc1 -tsp backup

           Store low precision modification and creation or ctime times.
           Preserve the last access time of source files.
           Alternatively we could use -tsm1c1p instead of -tsm1 -tsc1 -tsp.


   -u      Update files. May be used with archive extraction or creation.
           The command string "a -u" is equivalent to the command 'u', you
           could also use the switch '-u' with the commands 'm' or 'mf'. If
           the switch '-u' is used with the commands 'x' or 'e', then files
           not present on the disk and files newer than their copies on the
           disk would extracted from the archive.


   -v      Create volumes with size autodetection or list all volumes

           This switch may be used when creating or listing volumes.

           In the first case it enables volume size autodetection,
           so new volumes will use all available space on the destination
           media. It is convenient when creating volumes on removable
           disks. You may read more about volumes in -v<size> description.

           In the second case, when this switch is used together with
           'V' or 'L' command, it forces RAR to list contents of all
           volumes starting from that specified in the command line.
           Without this switch RAR displays contents of only one single
           specified volume.


   -v<size>[b|B|k|K|m|M|g|G|t|T]
           Create volumes of the specified size.

           Unit type character following the size value can be 'b' or 'B'
           for bytes, 'k' for kilobytes, 'K' for thousands of bytes,
           'm' for megabytes, 'M' for millions of bytes, 'g' for gigabytes,
           'G' for billions of bytes, 't' for terabytes, 'T' for trillions
           of bytes. If this character is not present, the size value
           is treated as thousands of bytes

           If the size is omitted, autodetection will be used.

           It is allowed to enter decimal fractions using the dot as
           the decimal mark. For example, -v1.5g means 1.5 gigabytes.

           You may specify several -v switches to set different sizes
           for different volumes. For example:

             rar a -v100k -v200k -v300k arcname

           sets 100 KB size for first volume, 200 KB for second
           and 300 KB for all following volumes.

           If volumes are created on removable media, then after
           the creation of the first volume, the user will be prompted
           with:

             Create next volume: Yes/No/All

           At this moment in time, you should change the disks. Answering
           'A' will cause all volumes to be created without a pause.

           RAR volumes have names like 'volname.partNNN.rar', where NNN
           is the volume number.
           
           Volumes created by older RAR versions could use the another naming
           scheme, where the first volume file in a multi-volume set had
           .rar extension, followed by volumes with extensions from .r00 to
           .r99. RAR can unpack such volumes, but doesn't use the extension
           based names for new archives.

           When extracting or testing a multi-volume archive you must use
           only the first volume name. If there is no next volume
           on the drive and the disk is removable, the user will be
           prompted with:

            Insert disk with <next volume name>

           Insert the disk with the correct volume and press any key.

           If while extracting, the next volume is not found and volumes
           are placed on the non-removable disk, RAR will abort with
           the error message:

            Cannot find <volume name>

           Archive volumes cannot be modified. The commands 'd', 'f', 'u',
           's' cannot be used with Multi-volume sets. The command 'a' may
           be used only for the creation of a new multi-volume sequence.

           It is possible, although unlikely, that the file size, of a file
           in a multi-volume set, could be greater than its uncompressed
           size. This is due to the fact that 'storing' (no compression if
           size increases) cannot be enabled for multi-volume sets.

           Archive volumes may be Self-Extracting (SFX). Such an archive
           should be created using both the '-v' and '-sfx' switches.

           Example:

           create solid volumes 1 GB each:

           rar a -s -v1g volume.rar bitmaps


   -vd     Erase disk contents before creating volume

           All files and directories on the target disk will be erased
           when '-vd' is used.  The switch applies only to removable
           media, the hard disk cannot be erased using this switch.


   -ver[n] File version control

           Forces RAR to keep previous file versions when updating
           files in the already existing archive. Old versions are
           renamed to 'filename;n', where 'n' is the version number.

           By default, when unpacking an archive without the switch
           -ver, RAR extracts only the last added file version, the name
           of which does not include a numeric suffix. But if you specify
           a file name exactly, including a version, it will be also
           unpacked. For example, 'rar x arcname' will unpack only
           last versions, when 'rar x arcname file.txt;5' will unpack
           'file.txt;5', if it is present in the archive.

           If you specify -ver switch without a parameter when unpacking,
           RAR will extract all versions of all files that match
           the entered file mask. In this case a version number is
           not removed from unpacked file names. You may also extract
           a concrete file version specifying its number as -ver parameter.
           It will tell RAR to unpack only this version and remove
           a version number from file names. For example,
           'rar x -ver5 arcname' will unpack only 5th file versions.

           If you specify 'n' parameter when archiving, it will limit
           the maximum number of file versions stored in the archive.
           Old file versions exceeding this threshold will be removed.

           When archiving with -ver switch, it is recommended to avoid
           names in 'filename;n' format among files to add. Such names
           can lead to duplicate entries if old version with same name
           either is present in archive or will be created later.


   -vp     Pause before each volume

           By default RAR asks for confirmation before processing
           next volume only when archiving to removable disks and only
           if free disk space is less than volume size. This switch
           forces RAR to always ask for such confirmation when creating
           or extracting volumes. For example, it can be useful if you
           wish to copy new volumes to another media immediately after
           creating.


   -w<p>   Assign work directory to <p>.
   
           RAR creates temporary files in some operations like archive
           modification. This switch can be used to specify the directory
           for such temporary files. This directory must already exist.

           Example:

           use d:\tmp directory for temporary files when adding a new
           comment to info.rar

           RAR c -wd:\tmp -zcomment.txt info.rar


   -x<f>   Exclude the specified <f> file or directory. Wildcards can be
           used in both the name and path parts of file mask. You can
           specify the switch '-x' several times to define several
           exclusion masks in the same command line.

           If mask contains wildcards, it applies to files in current
           directory and its subdirectories. It is not recursive without
           wildcards, so "filename" mask will exclude 'filename' file
           only in current directory when archiving or in root archive
           directory when extracting.

           Use "*\filename" syntax to exclude "filename" recursively
           in all directories.

           If you know the exact path to file, you can use "path\filename"
           syntax to exclude only this copy of "filename". If you use
           -xpath\filename syntax when unpacking an archive, "path" must be
           the path inside of archive, not the file path on the disk after
           unpacking.

           By default, masks containing wildcards are applied only to files.
           If you need a mask with wildcards to exclude several directories,
           use the special syntax for directory exclusion masks.
           Such masks must have the trailing path separator character
           ('\' for Windows and '/' for Unix). For example, "*tmp*\" mask
           will exclude all directories matching "*tmp*" and "*\tmp\" will
           exclude all 'tmp' directories. Since wildcards are present,
           both masks will be applied to contents of current directory
           and all its subdirectories.

           If you wish to exclude only one directory, specify the exact
           name of directory including the absolute or relative path
           without any wildcards. In this case you do not need to append
           the path separator to mask, which is required only for directory
           exclusion masks containing wildcards to distinguish them
           from file exclusion masks.

           Examples:

           1) rar a -r -x*.jpg -x*.avi rawfiles

           compress all files except *.jpg and *.avi in current directory
           and its subdirectories;

           2) rar a -r -x*\temp\ savec c:\*

           compress all files on the disk c: except 'temp' directories
           and files inside of 'temp' directories;

           3) rar x -x*.txt docs

           extract all files except *.txt from docs.rar.


   -x@<lf> Exclude files listed in the specified list file. If you use -x@
           without the list file name parameter, it will read file names
           from stdin.

           Example:

           rar a -x@exlist.txt arch *.exe


   -y      Assume Yes on all queries.


   -z[file]
           Read archive comment from file <file>.
           
           This switch can be used with any archive modification command
           to read the archive comment from file and add it to archive.
           Use with -sc switch if you need to specify the character set
           for comment text file. If <file> is not present, comment
           is read from stdin.



Limitations
~~~~~~~~~~~

   Command limitations:

   Commands 'd','u','f','c','cf' will not operate with archive volumes.

   Command 'a' cannot be used to update an archive volume, only to
   create a new one.


Exit values
~~~~~~~~~~~

   RAR exits with a zero code (0) in case of successful operation.
   Non-zero exit code indicates some kind of error:

   Code   Description   

    0     Successful operation.
    1     Non fatal error(s) occurred.
    2     A fatal error occurred.
    3     Invalid checksum. Data is damaged.
    4     Attempt to modify an archive locked by 'k' command.
    5     Write error.
    6     File open error.
    7     Wrong command line option.
    8     Not enough memory.
    9     File create error
   10     No files matching the specified mask and options were found.
   11     Wrong password.
   12     Read error.
  255     User stopped the process.


Glossary
~~~~~~~~

   Archive      Special file containing one or more files optionally
                compressed and/or encrypted.

   Compression  A method of encoding data to reduce it's size.

   Checksum     Value calculating for data block or file and allowing to
                check data or file validity.

   SFX archive  SelF-eXtracting archive. Archive in executable format,
                consisting of self-extracting module followed by
                compressed data. It is enough to run such executable to
                start extraction.

   Solid        An archive packed using a special compression method which
                sees all files as one continuous data stream. Particularly
                advantageous when packing a large number of small files.

   Volume       Part of a split archive. Splitting an archive to volumes
                allows storing them on several removable disks.
                Solid volumes must be extracted starting from first
                volume in sequence.