iis服务器助手广告广告
返回顶部
首页 > 资讯 > 服务器 >服务器使用——解压常见文件tar、zip、rar等
  • 315
分享到

服务器使用——解压常见文件tar、zip、rar等

服务器linux运维 2023-09-05 08:09:12 315人浏览 安东尼
摘要

服务器使用——解压常见文件tar、zip、rar等 一、解压文件 1.tar文件 tar -cf all.tar *.jpg # 这条命令是将所有.jpg的文件打成一个名为all.tar的包。-c是表

服务器使用——解压常见文件tar、zip、rar等

一、解压文件

1.tar文件

tar -cf all.tar *.jpg # 这条命令是将所有.jpg的文件打成一个名为all.tar的包。-c是表示产生新的包,-f指定包的文件名tar -rf all.tar *.jpg # 这条命令是将所有.jpg的文件增加到all.tar的包。-r是表示是增加文件tar -uf all.tar loGo.gif # 这条命令是更新原来tar包all.tar中logo.gif文件,-u表示更新文件tar -tf all.tar # 这条命令是列出all.tar包中所有文件,-t是列出文件的意思tar -xf all.tar # 这条命令是解出all.tar包中所有文件,-x是解开的意思# gzip 是 GNU 组织开发的一个压缩程序,.gz 结尾的文件就是 gzip 压缩的结果。与 gzip 相对的解压程序是 gunzip。tar 中使用 -z 这个参数来调用gziptar -czf all.tar.gz *.jpg # 这条命令是将所有 .jpg 的文件打成一个 tar 包,并且将其用 gzip 压缩,生成一个 gzip 压缩过的包,包名为 all.tar.gztar -xzf all.tar.gz # 这条命令是将上面产生的包解开# bzip2 是一个压缩能力更强的压缩程序,.bz2 结尾的文件就是 bzip2 压缩的结果。与 bzip2 相对的解压程序是 bunzip2。tar 中使用 -j 这个参数来调用 gzip。tar -cjf all.tar.bz2 *.jpg # 这条命令是将所有 .jpg 的文件打成一个 tar 包,并且将其用 bzip2 压缩,生成一个 bzip2 压缩过的包,包名为 all.tar.bz2tar -xjf all.tar.bz2 # 这条命令是将上面产生的包解开

在这里插入图片描述

2.zip文件

这篇关于zip博客写的挺全的,这里直接放链接

3.rar文件

首先下载RAR 6.21 for Linux x64

在这里插入图片描述

下载完后安装:

tar -xzpvf rarlinux-64-621.tar.gzcd rarmake 
unrar e -r [rar文件] [解压到的文件夹] # 其中,-e 表示解压、-r 表示递归处理,[rar文件] 是要解压的 RAR 文件,[解压到的文件夹] 是指定的文件夹。例如,解压 test.rar 文件到 /home/user/data 文件夹,命令如下:unrar e -r test.rar /home/user/data

加压后可以看到有一个rar.txt,里面有rar具体的使用方法。这里粘贴复制下来

 User's Manual ~~~~~~~~~~~~~                        RAR 6.21 console version                        ~~~~~~~~~~~~~~~~~~~~~~~~                       =-=-=-=-=-=-=-=-=-=-=-=-=-=-                       Welcome to the RAR ArcHiver!                       -=-=-=-=-=-=-=-=-=-=-=-=-=-= Introduction ~~~~~~~~~~~~    RAR is a console application allowing to manage archive files  in command line mode. RAR provides compression, encryption,  data recovery and many other functions described in this manual.    RAR supports only RAR fORMat archives, which have .rar file name  extension by default. ZIP and other formats are not supported.  Even if you specify .zip extension when creating an archive, it will  still be in RAR format. windows users may install WinRAR, which supports  more archive types including RAR and ZIP formats.    WinRAR provides both graphical user interface and command line mode.  While console RAR and GUI WinRAR have the similar command line syntax,  some differences exist. So it is recommended to use this rar.txt manual  for console RAR (rar.exe in case of Windows version) and winrar.chm  WinRAR help file for GUI WinRAR (winrar.exe). Configuration file ~~~~~~~~~~~~~~~~~~  RAR and UnRAR for Unix read configuration information from .rarrc file  in a user's home directory (stored in HOME environment variable)  or in /etc directory.  RAR and UnRAR for Windows read configuration information from rar.ini file,  placed in the same directory as the rar.exe file.  This file 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   [ - ]    [ <@listfiles...> ]        [  ]  [  ] 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 -scl 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 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]=            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 instead of i=            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    ...              For example, the following command:            rar rn data.rar readme.txt readme.bak info.txt info.bak            will rename readme.txt to readme.bak and info.txt to info.bak            in the archive data.rar.            It is allowed to use wildcards in the source and destination            names for simple name transformations like changing file            extensions. For example:            rar rn data.rar *.txt *.bak            will rename all *.txt files to *.bak.            RAR does not check if the destination file name is already            present in the archive, so you need to be careful to avoid            duplicated names. It is especially important when using            wildcards. Such a command is potentially dangerous, because            a wrong wildcard may corrupt all archived names.    rr[N]   Add data recovery record. Optionally, redundant information            (recovery record) may be added to archive. While it increases            the archive size, it helps to recover archived files in case of            disk failure or data loss of other kind, provided that damage            is not too severe. Such damage recovery can be done with            command "r" (repair).            RAR 4.x and RAR 5.0 archives use different recovery record            structure and algorithms.            RAR 4.x recovery record is based on XOR algorithm.            You can specify 4.x record size as a number of recovery sectors            or as a percent of archive size. To specify a number of sectors            just add it directly after 'rr', like 'rr1000' for 1000 sectors.            To use a percent append 'p' or '%' modifier after the percent            number, such as 'rr5p' or 'rr5%' for 5%. Note that in Windows            .bat and .cmd files it is necessary to use 'rr5%%' instead of            'rr5%', because the command processor treats the single '%'            as the start of a batch file parameter, so it might be more            convenient to use 'p' instead of '%' in this case.            RAR 4.x recovery sectors are 512 bytes long. If damaged area            is continuous, every sector helps to recover 512 bytes of            damaged information. This value may be lower in cases of            multiple damage. Maximum number of recovery sectors is 524288.            Size of 4.x recovery record may be approximately determined as            /256 + *512 bytes            and cannot exceed the protected data size or 256 MB,            whatever is less.            RAR 5.0 recovery record uses Reed-Solomon error correction codes.            Its ability to repair continuous damage is about the same            as for RAR 4.x, allowing to restore slightly less data than            recovery record size. But it is more efficient than RAR 4.x            record in case of multiple damaged areas and shifted data            positions.            RAR 5.0 record does not use 512 byte sectors and you can specify            its size only as a percent of archive size. Even if '%' or 'p'            modifier is not present, RAR treats the value as a percent            in case of RAR 5.0 format, so both 'rr5' and 'rr5p' mean 5%.            Due to service data overhead the actual resulting recovery record            size only approximately matches the user defined percent            and difference is larger for smaller archives.            Maximum allowed RAR 5.0 recovery record size is 1000%.            Larger recovery records are processed slower both when creating            and repairing.            RAR 5.0 recovery record is more resistant to damage of recovery            record itself and can utilize a partially corrupt recovery            record data. Note, though, that 'R' repair command does not fix            broken blocks in recovery record. Only file data are corrected.            After successful archive repair, you may need to create a new            recovery record for saved files.            If you use the plain 'rr' command without optional parameter,            RAR will set the recovery record size to 3% of archive size            by default.            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 rr5p arcname            add the recovery record of 5% of archive size.    rv[N]   Create recovery volumes (.rev files), which can be later            used to reconstruct missing and damaged files in a volume            set. This command makes sense only for multivolume archives            and you need to specify the name of the first volume            in the set as the archive name. For example:            rar rv3 data.part01.rar            This feature may be useful for backups or, for example,            when you posted a multivolume archive to a newsgroup            and a part of subscribers did not receive some of the files.            Reposting recovery volumes instead of usual volumes            may reduce the total number of files to repost.            Each recovery volume is able to reconstruct one missing            or damaged RAR volume. For example, if you have 30 volumes            and 3 recovery volumes, you are able to reconstruct any            3 missing volumes. If the number of .rev files is less than            the number of missing volumes, reconstructing is impossible.            The total number of usual and recovery volumes must not            exceed 255 for RAR 4.x and 65535 for RAR 5.0 archive format.            Original RAR volumes must not be modified after creating            recovery volumes. Recovery algorithm uses data stored both            in REV files and in RAR volumes to rebuild missing RAR volumes.            So if you modify RAR volumes, for example, lock them, after            creating REV files, recovery process will fail.            Additionally to recovery data, RAR 5.0 recovery volumes            also store service information such as checksums of protected            RAR files. So they are slightly larger than RAR volumes            which they protect. If you plan to copy individual RAR and REV            files to some removable media, you need to take it into account            and specify RAR volume size by a few kilobytes smaller            than media size.            The optional  parameter specifies a number of recovery            volumes to create. It must be less than the total number of            RAR volumes in the set for RAR 4.x and must not be larger            than tenfold amount of RAR volumes for RAR 5.0 format.            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  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 the Windows version default.sfx should be placed in the            same directory as the rar.exe, in Unix - in the user's            home directory, in /usr/lib or /usr/local/lib.    s-      Remove SFX module from the already existing SFX archive.            RAR creates a new archive without SFX module, the original            SFX archive is not deleted.    t       Test archive files. This command performs a dummy file            extraction, writing nothing to the output stream, in order to            validate the specified file(s).            Examples:            Test archives in current directory:            rar t *            or for Unix:            rar t '*'            User may test archives in all sub-directories, starting            with the current path:            rar t -r *            or for Unix:            rar t -r '*'    u       Update files in archive. Adds files not yet in the archive            and updates archived files that are older than files to add.    v[t[a],b]            Verbosely list archive contents [technical [all], bare].                'v' command lists archived file attributes, size, packed size,            compression ratio, date, time, checksum and name, one file            per line. If file is encrypted, line starts from '*' character.            For BLAKE2sp checksum only two first and one last symbol are            displayed.            'vt' displays the detailed file information in multiline mode.            This information includes file checksum value, host OS,            compression options and other parameters.            'vta' provide the detailed information not only for files,            but also for service headers like NTFS streams            or file security data.            'vb' lists bare file names with path, one per line,            without any additional information.            You can use -v switch to list contents of all volumes            in volume set: rar v -v vol.part1.rar            Commands 'vt', 'vta' and 'vb' are equal to 'lt', 'lta'            and 'lb' correspondingly.    x       Extract files with full path.            Examples:            1) extract 10cents.txt to current directory not displaying               the archive comment               rar x -c- dime 10cents.txt            2) extract *.txt from docs.rar to c:\docs directory               rar x docs.rar *.txt c:\docs\            3) extract the entire contents of docs.rar to current directory               rar x docs.rar    Switches (used in conjunction with a command):    -?      Display help on commands and switches.            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 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            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            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 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[+]            Specifies file exclude or include attributes mask.             is a number in the decimal, octal (with leading '0')            or hex (with leading '0x') format.            By default, without '+' sign before , this switch            defines the exclude mask. So if result of bitwise AND between             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 and -e+            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, so you            need to use -ma switch with it.            You can see checksums of archived files using 'vt' or 'lt'            commands.                Example:            rar a -ma -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 -scg 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=   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).    -ma[4|5]            Specify a version of archiving format.            By default RAR creates archives in RAR 5.0 format.            Use -ma4 to create RAR 4.x archives.            Use -ma5 or just -ma in case you need to override -ma4 saved            in configuration and force RAR to use RAR 5.0 format.            This switch is used only when creating a new archive.            It is ignored when updating an existing archive.    -mc            Set advanced compression parameters.            This switch is intended mainly for benchmarking and            experiments. In the real environment it is usually better            to allow RAR to select optimal parameters automatically.            Please note that improper use of this switch may lead            to very serious performance and compression loss, so use            it only if you clearly understand what you do.            It has the following syntax:            -mc[param1][:param2][module][+ or -]            where  is the one character field denoting a part            of the compression algorithm, which has to be configured.            It may have the following values:              A       - audio compression;              C       - true color (RGB) data compression;              D       - delta compression;              E       - x86 executable compression;              T       - text compression.            RAR 5.0 archive format supports only 'D' and 'E' values.            '+' sign at the end of switch applies the selected algorithm            module to all processed data, '-' disables the module at all.            If no sign is specified, RAR will choose modules automatically,            based on data and the current compression method.            Switch -mc- disables all optional modules and allows only            the general compression algorithm.             and  are module dependent parameters            described below.            Audio compression, delta compression:             is a number of byte channels (can be 1 - 31).            RAR splits multibyte channels to bytes, for example,            two 16-bit audio channels are considered by RAR as four            channels one byte each.             is ignored.            x86 Intel executable compression, true color (RGB) data            compression:             and  are ignored.            Text compression:            Text compression algorithm provides noticeably higher compression            on plain text data. But it cannot utilize several CPU cores            efficiently resulting in slower compression time comparing to            general algorithm in multicore and multiprocessor environment.            Also its decompression speed is much slower than in general            algorithm regardless of CPU cores number. This is why            the text compression is disabled by default. You can specify            -mct switch to allow RAR to select this algorithm automatically            for suitable data. Switch -mct+ will force use of the text            compression for all data.            Switch -mct can also include  and , so its            full syntax is -mc[param1][:param2]t[+ or -].             is the order of PPM algorithm (can be 2 - 63).            Usually a higher value slightly increases the compression ratio            of redundant data, but only if enough memory is available            to PPM. In case of lack of memory the result may be negative.            Higher order values decrease both compression and decompression            speed.             is memory in megabytes allocated for PPM (1-128).            Higher values may increase the compression ratio, but note            that PPM uses the equal memory size both to compress and            decompress, so if you allocate too much memory when creating            an archive, other people may have problems when decompressing            it on a computer with less memory installed. Decompression            will be still possible using virtual memory, but it may            become very slow.            Examples:            1) switch -mc1a+ forces use of 8-bit mono audio compression            for all data.            2) switch -mc10:40t+ forces use of text compression            algorithm for all data, sets the compression order to 10            and allocates 40 MB memory.            3) switch -mc12t sets the text compression order to 12,            when the text compression is used, but leaves to RAR to            decide when to use it.            4) switches -mct -mcd- allow RAR to apply the text compression            to suitable data and disable the delta compression.    -md[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 being compressed (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 4.x archive format the dictionary size can be:            64 KB, 128 KB, 256 KB, 512 KB, 1 MB, 2 MB, 4 MB.            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.            You can use 'k', 'm' and 'g' modifiers to specify the size            in kilo-, mega- and gigabytes, like -md64m for 64 MB dictionary.            If no modifier is specified, megabytes are assumed,            so -md64m and -md64 are equal.            When archiving, RAR needs about 6x memory of specified            dictionary size, so 512 MB and 1 GB sizes are available            in 64 bit RAR version only. When extracting, slightly more            than a single dictionary size is allocated, so both 32            and 64 bit versions can unpack archives with all dictionaries            up to and including 1 GB.            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 4 MB for RAR 4.x            and 32 MB for RAR 5.0 archive format.            Example:            RAR a -s -ma -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  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            switches for every file type.            If  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            Set the number of 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  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   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@ Read additional filter masks from list file.            Similar to -n 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][:]            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 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  value allows to define the minimum file size            threshold. Files smaller than  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  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 -ma 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]                        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 for RAR 4.x and RAR 5.0 archives in RAR for Unix            and only for RAR 5.0 archives in RAR for Windows.            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.    -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            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  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.    -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  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  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.            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

[:] Set priority and sleep time. Available only in RAR for Windows. This switch regulates system load by RAR in multitasking environment. Possible task priority

values are 0 - 15. If

is 0, RAR uses the default task priority.

equal to 1 sets the lowest possible priority, 15 - the highest possible. Sleep time 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 may be useful if you need to reduce system load even more than can be achieved with

parameter. Example: execute RAR with default priority and 10 ms sleep time: rar a -ri0:10 backup *.* -rr[N] Add data recovery record. This switch is used when creating or modifying an archive to add a data recovery record to the archive. See the '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: create solid archive sources.rar with 512 KB dictionary, recursing all directories, starting with the current directory. Add only .asm files: rar a -s -md512 sources.rar *.asm -r -s Create solid groups using file count Similar to -s, but resets solid statistics after compressing files. Usually decreases compression, but also decreases losses in case of solid archive damages. -sc[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 the Windows version default.sfx should be placed in the same directory as the rar.exe, in Unix - in the user's home directory, in /usr/lib or /usr/local/lib. 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 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 Process only those files, which size is less than specified in parameter of this switch. Parameter must be specified in bytes. -sm Process only those files, which size is more than specified in parameter of this switch. Parameter must be specified in bytes. -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] 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] 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. -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]

Assign work directory to

. 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 be 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 Exclude the specified 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@ 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 . 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 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. Copyrights (c) 1993-2023 Alexander Roshal

来源地址:https://blog.csdn.net/qq_43428929/article/details/129720166

--结束END--

本文标题: 服务器使用——解压常见文件tar、zip、rar等

本文链接: https://www.lsjlt.com/news/394933.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • 服务器使用——解压常见文件tar、zip、rar等
    服务器使用——解压常见文件tar、zip、rar等 一、解压文件 1.tar文件 tar -cf all.tar *.jpg # 这条命令是将所有.jpg的文件打成一个名为all.tar的包。-c是表...
    99+
    2023-09-05
    服务器 linux 运维
  • 微软 Win11 将原生支持 tar/7-zip/rar/gz 等格式压缩文件
    微软在今天的开发者大会上,宣布在 Win11 系统中改善对压缩文档的支持 我们注:Win10、Win11 系统中原生支持 zip 文件,用户可以通过右键菜单直接进行解压缩等操作。而当前使用上述压缩包文件,需要下载 7-...
    99+
    2023-05-24
    Win11 压缩文件 rar 7-zip
  • linux下tar、gz、zip等常用解压缩命令详解
    解压缩命令 tar命令tar参数tar使用 gz命令gz参数gz使用 zip命令总结 tar命令 tar是Unix和类Unix系统上的归档打包工具,可以将多个文件合并为一个文件,打包后尾缀.tar。目前,tar文件格式已...
    99+
    2023-08-20
    linux 服务器 unix
  • 如何在linux中使用tar.gz、tar、bz2、zip等解压缩命令
    如何在linux中使用tar.gz、tar、bz2、zip等解压缩命令?相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。Linux下最常用的打包程序就是tar了,使用tar程序打出...
    99+
    2023-06-13
  • 怎么使用Python破解ZIP或RAR文件密码
    这篇文章主要介绍怎么使用Python破解ZIP或RAR文件密码,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!一、破解原理其实原理很简单,一句话概括就是「大力出奇迹」,Python 有两个压缩文件库:zipfile 和...
    99+
    2023-06-15
  • 使用JavaScript怎么在线解压 ZIP 文件
    本篇文章给大家分享的是有关使用JavaScript怎么在线解压 ZIP 文件,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。一、ZIP 格式简介ZIP 文件格式是一种数据压缩和文...
    99+
    2023-06-15
  • Win10如何使用自带压缩、解压zip压缩文件功能
      Windows系统自带不少工具,到了Win10,好用的功能依然保留,比如压缩/解压zip压缩文件的功能。压缩文件能为系统节省空间,这一功能必不可少。Win10如何使用压缩/解压zip压缩文件功能?   Win10压缩...
    99+
    2023-06-10
    Win10 压缩 功能 自带 压缩文件
  • PHP实现文件夹压缩、解压及zip文件在服务器之间的传输
    如果有两个项目分布在两台服务器上,并且需要经常的传递文件夹或者文件,那么就需要考虑将文件夹或者大文件压缩后进行传输。 压缩与解压代码如下: public static function zipFolder($sourcePath...
    99+
    2023-09-06
    后端 服务器 Powered by 金山文档
  • 在Linux系统中怎么使用tar命令压缩和解压文件
    本篇内容介绍了“在Linux系统中怎么使用tar命令压缩和解压文件”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!linux中的tar命令ta...
    99+
    2023-06-13
  • CentOS中如何使用tar命令打包和解压文件
    在CentOS中,可以使用tar命令来打包和解压文件。以下是一些常用的tar命令示例: 打包文件: tar -czvf arch...
    99+
    2024-04-02
  • 如何使用Python解决简单的zip文件解压密码
    小编给大家分享一下如何使用Python解决简单的zip文件解压密码,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!文件创建首先测试文件为test.txt(仅包含单行文本),压缩后文件为test.zip,压缩密码为2340,压...
    99+
    2023-06-25
  • ASP.NET Core文件压缩常见使用误区是什么
    这篇文章主要介绍了ASP.NET Core文件压缩常见使用误区是什么,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。误区1:未使用Brotil 压缩  几乎不需要任何额外的代价...
    99+
    2023-06-15
  • ASP.NET Core 文件响应压缩的常见使用误区
    目录误区1:未使用 Brotil 压缩误区2:使用 Fastest 级别的 Brotli 压缩误区3:使用 Optimal 级别的 Brotli 压缩误区1:未使用&nbs...
    99+
    2024-04-02
  • Shell中怎么上传zip压缩文件到FTP服务器
    本篇文章为大家展示了Shell中怎么上传zip压缩文件到FTP服务器,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。代码如下:# /bin/bash# creator:lihuib...
    99+
    2023-06-09
  • 云服务器中如何解决linux下zip文件解压乱码问题
    这篇文章给大家介绍云服务器中如何解决linux下zip文件解压乱码问题,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。云服务器:解决linux下zip文件解压乱码问题由于zip格式并没有指定编码格式,Windows下生成...
    99+
    2023-06-05
  • ASP.NET Core文件压缩常见使用误区(最佳实践)
    前言   在微软官方文档中,未明确指出文件压缩功能的使用误区。   本文将对 ASP.NET Core 文件响应压缩的常见使用误区做出说明。 误区1:未使用Brotil 压缩   几...
    99+
    2024-04-02
  • 云服务器文件解压程序怎么使用
    使用云服务器文件解压程序的步骤如下:1. 登录到云服务器上,可以通过SSH或其他远程登录方式进行登录。2. 确保服务器上已经安装了文...
    99+
    2023-08-19
    云服务器
  • 手把手教你使用Python解决简单的zip文件解压密码
    目录简介文件创建纯数字密码字母数字混合密码补充说明简介 使用的核心模块是python标准库中的zipfile模块。这个模块可以实现zip文件的各种功能,具体可以查看官方参考文档。这里...
    99+
    2024-04-02
  • 通过minio服务器压缩文件的下载和解压
    1:下载压缩文件到本地服务器 //下载压缩文件 public static void main(String[] args) { try { // 初...
    99+
    2023-09-02
    服务器 java servlet
  • Linux 服务器文件名乱码常见问题
    在 Linux 服务器中,文件名乱码是一个常见的问题,特别是当涉及到多语言字符集时。这可能导致文件名显示异常,无法正确识别和处理文件。本文将介绍一些常见的文件名乱码问题以及相应的解决方法。 字符集问题 文件名乱码的一个常见原因是字符集不匹...
    99+
    2023-12-22
    服务器 linux java
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作