Use of RAR under Linux operating system

Source: Internet
Author: User

operation of the ============zip file ==================================
Zip-r Data.zip Data
Explanation: The data folder was compressed into the data.zip format.

Unzip Data.zip
Explanation: Extract the Data.zip file to the current folder.
-----------------The following are some detailed instructions--------------------------
1. I want to compress a file abc.txt and a directory dir1 into Yasuo.zip:
# zip-r Yasuo.zip abc.txt Dir1
2. I downloaded a yasuo.zip file and want to unzip it:
# Unzip Yasuo.zip
3. I have Abc1.zip,abc2.zip and Abc3.zip in the current directory, and I want to unzip them together:
# unzip abc\? Zip
Note: A character is represented if any number of characters are represented by *.
4. I have a very large compressed file large.zip, I do not want to decompress, just want to see what is inside it:
# unzip-v Large.zip
5. I downloaded a compressed file large.zip, want to verify that the compressed file is completely downloaded
# unzip-t Large.zip
6. I use the-v option to find that Music.zip compressed files have many directories and subdirectories, and the subdirectories are actually songs mp3 files, I would like to download these files to the first level directory, rather than a layer of building a directory:
# unzip-j Music.zip

====================rar File ==========================
Under Liunx is originally not support RAR file, need to install Liunx under the WinRAR version, operation as follows
wget http://www.rarsoft.com/rar/rarlinux-4.0.1.tar.gz
TAR-ZXVF rarlinux-4.0.1.tar.gz
CD rar
Make
See the following message that the installation was successful.
Mkdir-p/usr/local/bin
Mkdir-p/usr/local/lib
CP rar Unrar/usr/local/bin
CP Rarfiles.lst/etc
CP Default.sfx/usr/local/lib
Let's remember two common commands:
RAR x Vpsyou.rar//unzip Vpsyou.rar to current directory
RAR vpsyou.rar./vpsyou.com///Package vpsyou.com directory as Vpsyou.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.
TA operates only after the data date file
TB only operates on data pre-date files
Note that the format of date is YYYYMMDDHHMMSS.
V[K,B] Sub-volume compression, each volume size specified by the following size
Example: RAR a-v15000k-m0 Test Xvid-fn.avi
Package storage for Xvid-fn.avi, size 15000k per volume (this format is popular when publishing DVDRip online)
The generated file name is Test.part1.rar,test.part2.rar .... (RAR version 3.20)
X exclude a specific file
Example: rar x test.rar-x *.txt
Extract documents except *.txt in Test.rar
[email protected] ditto, but this time all excluded files are placed in list file lists
Y all actions are answered yes
For example, sometimes when extracting each encounter the same file to ask whether to overwrite (y/n), plus-y can choose Yes by default, no longer ask

Use of RAR under Linux operating system

Related Article

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.