CentOS + rar + unrar install rarunrar and usage

Source: Internet
Author: User
Contents./contents...

 

Write down the two most common rar commands

Package the www.2cto.com directory as www.2cto.com. rar

 

# Rar wwww.2cto.com. rar./www.2cto.com/

Decompress andy.rar to the current directory

 

# Rar x www.2cto.com. rar

CentOS + rar + unrar installation

 

# Vi/etc/yum. repos. d/dag. repo

Add the following content

 

[Dag]

Name = Dag RPM Repository for Red Hat Enterprise Linux

Baseurl = http://apt.sw.be/redhat/el?releasever/en/?basearch/dag

Gpgcheck = 1

Enabled = 1

Gpgkey = http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

Then install yum directly.

 

# Yum-y install rar unrar

Detailed explanation of rar + unrar commands

 

# Rar -- help

Usage: rar <命令> - <选项1> - <选项n> <压缩档案> <文件...>

<@ File list...> <解压缩路径\>

 

<命令>

A. add the file to the compressed file.

C. add compressed file comments (the comment size cannot exceed 62000 bytes)

Cf add file remarks (the file remarks are displayed when the 'V' parameter is used, and the maximum value cannot exceed 32767 bytes)

Ch changes the file compression parameters

Cw writes archive remarks to a specified file

D. delete an object from the archive.

E. decompress the file to the current directory (no subdirectories are created)

F. refresh the files in the archive. (update the files generated after they are packaged. do not add new files to the compressed archive)

I [par] = Search for specific characters in an archive

K. lock the file (any command that tries to change the content in the compressed file will be ignored)

L [t, B] List Archives [technical, bare]

M [f] move to the compressed file [only for files]

P print the file to the standard output

R patch compressed files

Rc reconstruction of lost volume shards

Rn rename the file in the compressed file

Rr [N] add data recovery Records

Rv [N] create recovery volume

S [name |-] Conversion between compressed files and SFX (self-extracting files)

T test compressed file

U updates files in the compressed file

V [t, B] lists detailed information about compressed files [technical, bare]

X decompress to the complete path

 

<选项>

-Stop scanning of options

Ad append the file name to the target path

Ag [format] uses the current data to generate the compressed file name

Ap Set the path inside the archive

As synchronization file directory

Av sets authentication detection (only the registered version provides this function)

Av-disable authentication detection

C-disable remark display

Cfg-disable read settings

Cl to lowercase letters

Cu conversion name: uppercase letters

Delete the original file after df compression

Dh open shared files

Ds disables name sorting for solid files

Delete files after dw compression

E [+] setting file exclusion and inclusion attributes

Ed does not add an empty directory

En does not set the end block of the file

The ep name does not contain a path.

The ep1 name does not contain the basic file directory.

Ep3 expand the path to the fully-contained drive name

F. refresh the file

Hp [password] encrypts file data and file headers

Id [c, d, p, q] to disable the message

Ierr sends all messages to standard error output

Ilog [name] records error logs to files (this function is only available for the registered version)

Inul disables all messages

Enable isnd

K. lock the compressed file

Kb to keep corrupted files decompressed

M <0 .. 5> sets the compression level (0-storage... 3-default... 5-maximum)

Mc Set advanced compression parameters

Md Dictionary size in KB (64,128,256,512,102, 4096, or A-G)

MS [ext; ext] stores the specified file type

N Only contains the specified file

N @ read the file name from the standard input to the contained content

N @ Include files in the specified list file

O [+ |-] set rewrite mode

Ol saves symbolic connections for files as connections

Or automatically rename the file

Owner and group of live storage files saved by ow

P [password] set the password

P-no password inquiry

R performs recursive operations on subdirectories.

R0 only uses the wildcard name for recursive operations on sub-directories

Rr [N] add data recovery Records

Rv [N] Creation and recovery

S [ , V [-], e] creating solid file compression

S-disable solid file compression

SC [Obj] set the specified string

Sfx [name]: Create an SFX file

Si [name] reads data from standard input

Sl The size of the processed file is smaller than the specified value.

Sm The size of the processed file is greater than the specified value.

T compressed test file

Ta Process the files modified after the specified date, Format: YYYYMMDDHHMMSS

Tb Process files whose modification date is earlier than the specified date, Format: YYYYMMDDHHMMSS

Tk maintains the initial time of the file

Tl sets the file time to the latest file Time

TnProcess new files at a specified time

ToProcess files older than the specified time

Ts [N] storage or storage time (modify, create, access)

U update file

V. create an automatic volume or list all volumes

V [K, B] create a specified volume size = * 1000 [* 1024, * 1]

Ver [n] file version control

Vn uses the old Volume naming system

Vp stops before each volume

W Specify working directory

X Exclude specified files

X @ exclude the names of objects read from standard input

X @ Specifies the file to be excluded from the specified list file.

Y. set all answers to yes.

Z [file] remarks on reading compressed files from files

Note: rar's <命令> Some do not contain "-", only <选项> Some of them contain "-". pay attention to this.

 

Example 1: add a file or directory to the compressed file and use the command. Deleting file (the original file1 file will be deleted after compression is completed. note: The m command only operates on the file)

 

# Rar a abc.rar file1

Description: If a file1 file exists in the abc.rar file, the file1 file is updated. In addition, the original file1 file still exists in the current directory. to move the file1 file to file1.rar, run the m command. you can also perform this operation on the directory.

Note: If you only enter the "rar a file1.rar" command but do not have a file name or directory name, all the files and directories under the current directory will be compressed into the file1.rar file. Pay attention to this.

 

Example 2: decompress the content in the abc.rarfile. you can use the EOR xcommand. assume that the directory abc.rar contains a file named file1 and a directory named test. The Directory test contains a file named file2,

 

# Rar e abc.rar

Note: With the ecommand, the file1 file in abc.rar, together with the file2 file in the test Directory, will be decompressed to the current directory. If you want to keep the directory structure in the abc.rar Directory, use the x command.

 

# Rar x abc.rar

Note: The file1 file and the test directory will be decompressed to the current folder.

 

Example 3: add comments to the entire compressed file

 

# Rar c abc.rar

Note: The command is displayed at the bottom of the screen.

 

Processing archive test.

RarReading comment from stdin

 

And there is a cursor flashing, from the cursor blinking position input comment information, input the end of the input press Ctrl + D

 

Example 4: add comments to a single file in the compressed file and use the cf command. Now, add comments to the file1 file in the abc.rar file.

 

# Rar ch abc.rar file1

At the bottom of the screen

 

Reading comment for abc.rar: file1 from stdin

 

The comment to be added for file1 is flashed from the cursor, and Ctrl + D is used to end the input.

 

Example 4: write the comment of the entire file into a file and use the cw command. To add abc.rarto the test.txt file

 

# Rar cw abc.rar test.txt

Description: The original content in plain text is written into text.txt.

 

Example 4: delete the file or directory in the compressed file and run the d command. For example, delete the file1 file in the abc.rar file.

 

# Rar d abc.rar file1

Note: this command deletes the file1 file in the abc.rar file, which is also valid for directories.

 

The preceding are common compression and decompression commands, <选项> I will not introduce the use of this part. please try it by yourself.

 

Unrar command:

 

# Unrar -- help

 

Usage: unrar- -

<@ Listfiles...>

 

<命令>

E. decompress the file to the current directory.

L [t, B] list compressed document information [technical, bare]

P print the file to the standard output

T test compression I am Russian

V [t, B] lists detailed information about compressed documents [technical, bare]

X decompress the file to the complete path

The unrar command has the same effect as the rar command. it can be seen that the unrar command only contains a part of the rar command. Therefore, the rar command can be used to complete all operations.

 

From qeenoo's blog

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.