RAR for Linux commands

Source: Internet
Author: User

Detailed usage of RAR for Linux commands: rar <command>-<switch 1>-<switch N> <compressed file> <file...> <@ list file...> <decompress path/> <command> a. Add a file to the compressed file c. Add a compressed file c. Add a file c. Add a file c. Write a compressed file c. delete a file in the compressed file e. decompress the compressed file. to the current directory f refresh the file in the compressed file I [parameter] = <string> SEARCH FOR THE STRING k in the compressed file to lock the compressed file l [t, b] list compressed files [technical information, concise] m [f] Move to compressed file [only file] p print file to standard output device r repair compressed file rc reconstruction lost volume rn rename compressed file rr [N] add data recovery record rv [N] Create recovery volume s [name |-] convert compressed file to self-decompressed format or convert back to compressed file t test compressed file u update compressed file v [t, b] detailed list of compressed files [technical information, concise] x Extract files using absolute paths <switch>-stop scanning ac compression or After decompression, clear the File Attribute ad and add the compressed file name to the target path ag [format] use the current date to generate the compressed file name ao Add the file with the compression attribute ap <format> Add the path to the compressed file synchronize compressed file content av Add User identity verification (only available in the registered version) av-Disable User identity verification c-Disable annotation display cfg-Disable read configuration cl name conversion to lowercase cu name conversion to uppercase df compression then delete file dh open shared file ds solid compression File disable name sorting e <Properties> set file exclusion attribute ed do not add empty directory en do not add "compressed file end" Mark ep exclude path ep1 from name exclude base Directory ep2 expand full path f refresh file hp [Password] simultaneously encrypt file data and file header idp disabled percentage display ieml [attribute] use E-mail to send compressed file ierr to send all messages to standard error device ilog [name] Write the error to the log file (only the registered version is available) inul disable all messages ioff after one operation is completed, disable PC power The source isnd enables the sound k to lock the compressed file kb and retain the damaged decompressed file m <0 .. 5> set the compression level (0-storage... 3-default... 5-max) mc <parameter> set advanced compression parameter md <size> dictionary size in KB (64,128,256,512,102, 4096, or A-G) MS [ext; ext] specified file type o + overwrite existing file o-Not Overwrite existing file OS save NTFS stream ow save or restore file owner and group p [Password] Set Password p- do not ask the password r recursive subdirectory r0 only the recursive subdirectory ri of the wildcard name <P> [: <S>] set priority (0-default, 1-minimum .. 15-max) and the sleep time in milliseconds rr [N] Add a data recovery record rv [N] Create a recovery volume s [<N>, v [-], e] create a solid compression File s-Disable the solid compression file sfx [name] Create a self-decompressed compressed file t after compression test file ta <date> Add date <date> modified files, date Format YYYYMMDDHHMMSStb File Modified before <date> Add date <date>, date Format: YYYYMMDDHHMMSStk retain original compressed file time tl set the compressed file time to the latest file time tn <time> add files after <time> to <time> add files before <time> ts <m, c, a> [N] file retention or recovery time (modify, create, access) u Update file v automatically detects the size of the created volume or lists all the volumes v <size> [k, B] Create volume size = <size> * 1000 [* 1024, * 1] Clear disk content before vd creates capacity ver [n] file version control vn use old-style volume naming scheme vp pause before each volume w <path> specify working directory x <File> exclude the specified file x @ read the file name to be excluded from the standard input device x @ <list> exclude the file y in the specified list file. Assume that all requests are answered as z <File> example of comments for reading compressed files: 1. rar a file file.extif file.rar does not exist Create a file.rarfile if the file already exists in the file.rar package. ext: updates the file in the compressed package. ext; d :/*. ext replaces file. ext adds all ext files (excluding self-folders) in drive D to the compressed package. 2. rar a-r-v2000-s-sfx-rr file compresses all files from the current folder and subfolders into 2000000 bytes, fixed, and self-extracting file file.part1.exe, file.part2.rar, file.part3.rar, etc, add a recovery record to each volume. Replace command a with command m to compress the file and delete 3. rar x Fonts *. ttf will decompress the compressed file *. ttf font file to the current folder, but the following command: rar x Fonts *. ttf NewFonts/decompress the compressed file *. ttf font file to folder NewFont 4, rar a-pZaBaToAd-r secret games /*. * use the password ZaBaToAd to add the "games" Contents of the folder to the compressed file "secret" 5. rar a-r a.rar a/recursively compress all the "a" and "a" to a.rar "to download one from the Internet. In rar for linux, the suffix of the program is tar.gz, which indicates that it is compressed in Unix file format. We can use it in the terminal (this command can be completed only in the Super User State !) Tar-zxvf filename.tar.gz -- directory =/opt (opt can also be any folder to be installed). Then, we can transfer it to the folder installed in rar for linux and execute the make command once, however, for ease of use, we can create two symbols in usr/bin to connect [root @ walter downloads] # ln-s/opt/rar/usr/bin/rar [root @ walter downloads] # ln-s/opt/rar/unrar/usr/bin/unrar is installed, after installation, there will be the rar and unrar programs, rar is the compression program, and unrar is the decompression program. They have many Parameter options. Here we will only give a brief introduction and give an example to illustrate their usage: (there may be a lack of libraries. For details, refer to the following) # rar a all * .jpgthis command is to compress all. jpg files into a rarpackage named all.rar. the program will automatically attach the. rar extension name to the package name. # Unrar e all.rar this command is to extract all files from all.rar. Install rarlinux-3.6.tar.gz, but I downloaded the rarlinux-3.7.1.tar.gz software and cannot be installed successfully. so library files) find several methods on the Internet to solve rarlinux. 1. Unzip the files and make them directly (but with this method, the following error occurs: unrar: error while loading shared libraries: libstdc ++. so.6: cannot open shared object file: No such file or directory) 2. According to the above prompt, echo $ PATH, and then convert libstdc ++. so.6 is added to the system directory 3. There is an rar_static file in the unlocked file. This is the static-linking version. You can use this program. Cp rar_static/usr/local/bin/rar subsequently uses the rar a method to create a compressed file, and rar x to unbind the file. The third method prompts FATAL: kernel too old that the kernel is to be upgraded! ========================================================== ========================================================= Method: download the rarlinux_3.6.0.tar.gz software again. Use the third method. Everything is OK! However, the first method still does not work, and an error is prompted. **************************************** *********************** Rar command details rar e arm.rar file1 file2... compressed file... To arm.rar rar x arm.rar, extract rar x arm.rar-ap path to the folder... Usage: rar <command>-<Option 1> .... -<Option N> <operation documentation> <file...> <@ File list…> <Decompression path> normally, the rarcommand is composed of a main command (Optional). The operating document is the. rar file object applied to the operation. The file or file list is the specific file or directory to be modified for the Operation Document ). Common commands of export rar include adding a file to the operation documentation example: rar a test.rar file1.txt example: rar a test.rar file2.txt if the test.rarfile already exists, then export file2.txtfile to test.rar (there are two files in this example test.rar, if a copy of a file already exists in the Operation Document, the command updates the file, and you can perform the following operations on the directory: rar a test.rar dir1 c add instructions to the Operation Document rar c test.rar (Reading comment from stdin will appear, and then enter one or more lines of comments to end with ctrl + d) cf add File annotation, similar to the above c, but this is to annotate each file in the compressed document cw write the document annotation into the file example: rar cw test.rar comment.txt d delete the file from the document example: rar d test.rar file1.txt e decompress the file to the current directory, for example, rar e test.rar. Note: If you use ETO extract the original file1.txtand file2.txt files to the current directory, all the files in dir1 are extracted to the current directory, the directory structure before compression cannot be maintained. if you want to maintain the directory structure before compression, use x to decompress k to lock the document. For example, after rar k test.rar locks the document, this document cannot be updated. For example, rar r test.rar. When there is a problem with the rarfile, you can use this command to fix the problem (ghost knows how much data is used) for example, rar s test.rar will generate a test. sfx executable document. This is equivalent to rar x test.rar. It is suitable for transferring files to users without rar. For example, rar t test.rar checks the integrity of test.rar, generally, it is recommended to use this command to ensure file correctness before compressing large files and preparing for transmission. x. Extract the content in the file to the current directory. For example, rar x test.rar, dir1 will keep the original directory structure above the common commands of rar. One rar operation can only have one command, but multiple options can exist. ------------------------------------------------------------------------ There are many rar options, which cannot be described one by one. It only demonstrates how to convert a file name to a lower-case cu by using several frequently used cl: rar a-cl test.rar FILe.txt file.txtafter logging into test.rar, it is changed to FILe.txt df. Delete the source file example: rar a-df test.rar file1.txt file2.txt dir1 after deleting the source file ed without adding an empty directory example: when rar a-ed test.rar dir1 has dir1to test.rar, when rar e-ed test.rar is not operated on an empty directory, no empty directory k lock is generated. Fixed file example: rar a-k test.rar file1.txt is equivalent to rar a test.rar file1.txt rar k test.rar m <0 .. 5> set the compression ratio level (0-storage, 3-default, 5-maximum). For example, rar a-m0 test.rar dir1 dir2 stores dir1,dir2into test.rar without substantial compression (fast, it is suitable for operations on files without much pressure, such as avi and jpg. rar a-m5 test.rar *. txt *. bmp compression, the use of the maximum compression ratio (slowest) ms [ext; ext] specific files using non-compression mode example: rar a-m5-ms avi; jpg; jpeg test.rar/home will be homecontents all directories and files archive to test.rar, max compression, but avi, jpg, and jpeg files Do not compress (only package test.rar, because these files use the maximum compression is not much pressure, it is better to save time directly) o + overwrite existing files o-Not Overwrite existing files example: rar x-o-test.rar uncompressed the test.rar file, but if an existing file exists, it does not overwrite ol and saves the symbolic link as a link file, instead of storing or recovering the owner information (username, group) of normal file ow, these two commands are unique to the * nix system. It is easy to understand the following: rar a test.rar *. in the txt-p prettygirl compressed file, set the password to prettygirl. If you do not have a password during decompression, you can use rar a test.rar *. txt -P then the rar program will ask you what password you want to use, do not show back s-do not use solid compression injection, solid compression is the compression method that cannot be changed after compression of the document content, this is different from lock. Because the use of common compression needs to take care of the need to insert and delete individual files in the future, there is a lot of room for operation. However, solid compression cannot update its content, so the compression ratio is the largest. Sfx [name] is used to create a self-extracting file, which is the same as compressing with a and converting with s. The integrity test is performed after t compression. For example, after rar a test.rar/home-t compression is completed, an error is returned. Ta <date> only performs operations on files after the data date. tb <date> only applies to files before the data date. The format of date is YYYYMMDDHHMMSS. V <size> [k, B] volume compression, each volume size is specified by the following size example: rar a-v15000k-m0 test xvid-fn.avi for xvid-fn.avi packaging storage, the size of each volume is 15000 KB (this format is popular when dvdrip is published online). The generated file name is test.part1.rar,test.part2.rar .... (Rar 3.20) x <file> exclude specific file examples: rar x test.rar-x *. remove *. documents other than txt x @ <list> are the same as above, however, if all excluded files are put in the list file list, all operations y will answer yes. For example, if you encounter the same file during decompression, you will be asked whether to overwrite (Y/N ), with-y, you can select Yes by default and do not ask again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.