Linux under RAR command detailed

Source: Internet
Author: User
Tags rar

Linux under RAR command detailed

Usage: RAR < command >-< options 1> ....-< options n> < action document > < file ...> <@ file list ...> < decompression path >

A Adding files to compressed files
C Add a compressed file comment
Cf Add a file comment
cw Write a compressed file comment to a file
D Delete files in a compressed file
E Unzip the compressed file to the current directory
F Refreshing files in a compressed file
i[parameter]=< string > Find a string in a compressed file
K Locking Compressed files
L[T,B] list compressed files [technical information, concise]
M[F] Move to compressed file [file only]
P Print files to standard output devices
R Repairing compressed Files
Rc Rebuilding a missing volume
Rn Renaming a compressed file
Rr[n] Adding Data Recovery records
Rv[n] Create a recovery volume
s[name |-] Convert compressed file to self-extracting format or convert back to compressed file
T Test Compressed files
U Update files in a compressed file
V[T,B] Detailed list of compressed files [technical information, concise]
X Extract files with absolute path

Example:

RAR a file File.ext 1.
If File.rar does not exist, the File.rar file will be created, and file.ext in the compressed package will be updated if File.ext is already present in the File.rar compressed package; Ext replaces file.ext To add all ext files (excluding self-folders) under the D disk to the compressed package.

2. rar a-r-v2000-s-sfx-rr file
Compress all files from the current folder and subfolders into 2000000-byte size, solid, self-extracting file File.part1.exe,file.part2.rar,file.part3.rar, etc. and add recovery records to each of the volumes ; change command A to command m to compress the file and delete it

3. rar x Fonts *.ttf
The *.ttf font file is extracted from the compressed file to the current folder, but the following command:
rar x Fonts *.ttf newfonts\
The *.ttf font file is extracted from the compressed file to the folder NewFont

4. rar A-pzabatoad-r Secret Games\*.*
Use password Zabatoad to add the contents of the folder "Games" to the compressed file "secret"

5. rar A-r A.rar A/
Recursively compresses everything down to A.rar.

RAR Common commands are mainly
A add file to action document
Example: rar a test.rar file1.txt if Test.rar file does not exist, then package file1.txt file into Test.rar
Example: rar a test.rar file2.txt if Test.rar file already exists, add file2.txt file to Test.rar
(so there are two files in the Test.rar)
Note, if a copy of a file is already in the action document, the A command updates the file, and the directory can be manipulated
Example: rar a test.rar dir1

C Add notes to the action document
RAR C Test.rar
(The reading comment from stdin appears, and one or more lines of comments are entered to end the Ctrl+d)
CF adds a file comment similar to the one above, but this is a comment on each file in the compressed document

CW writes a document comment to a file
Example: RAR CW Test.rar comment.txt

D Delete files from the document
Example: RAR d test.rar file1.txt

E Unzip the file to the current directory
Example: RAR e Test.rar
Note: With e decompression, not only the original file1.txt and file2.txt are extracted to the current directory, even dir1 inside all the files
Also extracted to the current directory, can not keep the directory structure before compression, if you want to keep the directory structure before compression, with X decompression

K Lock Document
Example: RAR k Test.rar when the document is locked, the document is unable to perform any update operations.

R Repair Document
Example: RAR r Test.rar
When there is a problem with the RAR file, you can try to repair it with this command (ghost knows how much to use)

s convert document into self-extracting document
Example: RAR s Test.rar
Generates a TEST.SFX executable that runs as a rar x Test.rar,
Suitable for transferring files to users without RAR

T Detection documentation
Example: RAR t Test.rar
Detection of the integrity of test.rar, generally compressed large files ready for transmission before the best use of this command to ensure the correctness of the file

X with path to extract contents from document to current directory
Example: rar x Test.rar
If you unzip this, Dir1 will keep the original directory structure.

The above is the common command of RAR, a RAR operation can only have one command, but the option can have more than one.
------------------------------------------------------------------------
There are many RAR options, which cannot be explained here, only a few of the frequently used

CL converts the file name to lowercase
CU converts the file name to uppercase
Example: RAR a-cl test.rar FILe.txt
FILe.txt changes to file.txt after adding into Test.rar

Delete source files after DF document operation
Example: RAR a-df test.rar file1.txt file2.txt dir1
After you compress file1.txt,file2.txt,dir1 into Test.rar, delete the source file

Ed does not add an empty directory
Example: RAR a-ed test.rar Dir1
No empty directory operation when adding Dir1 to Test.rar
RAR e-ed Test.rar
Empty directory is not generated when extracting Test.rar

K Lock File
Example: RAR a-k test.rar file1.txt
Equivalent to rar a test.rar file1.txt
RAR k Test.rar

M<0..5> set compression ratio level (0-storage, 3-default, 5-MAX)
Example: RAR a-m0 test.rar dir1 dir2
Storage of DIR1,DIR2 to Test.rar without substantial compression (extremely fast, suitable for operation with no very compressible files
such as avi,jpg, etc.)
RAR A-M5 Test.rar *.txt *.bmp
Package the TXT file and BMP file in the current directory into Test.rar, using the maximum compression ratio (slowest)

Ms[ext;ext] Specific files are non-compressed
Example: RAR a-m5-ms avi;jpg;jpeg test.rar/home
Archive all directories and files in the home directory to Test.rar with maximum compression, but avi,jpg,jpeg files are not compressed
(Just pack into the Test.rar, because these files will not press much even with the maximum compression, it is better to package directly save time)

o+ Overwrite Existing Files
o Do not overwrite existing files
Example: RAR x-o-Test.rar
Unzip the Test.rar file, but does not overwrite if it encounters a file that exists

Ol stores symbolic links as linked files instead of regular files
ow save or restore the file owner's information (Username,group)
These two are *nix system-specific commands that are easy to understand.
------------------------------------------------------------------------
P[password] Set Password
Example: rar a test.rar *.txt-p prettygirl
Compressed file Set Password is prettygirl, decompression without password can not operate
If you feel that the code is too exposed, you can use
RAR a Test.rar *.txt-p
The RAR program will ask you what password you want to use, do not echo

S-Do not use solid compaction
Note, solid compaction is the compression of the contents of the compressed document, which is not the same as lock. Because using normal compression
The need to take care of future insertions to delete individual files leaves a lot of room for manoeuvre. and solid compaction can not
Any updates to its content, so the compression ratio is the largest.

Sfx[name] Create a self-extracting file, which is compressed with a first, and then the S conversion effect is the same.

Integrity check after T-compression is complete
Example: RAR a test.rar/home-t
After the compression has been tested, if there is a problem error

Linux under RAR command detailed

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.