← 返回命令列表

Linux command

rar 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Create archive

rar a [archive.rar] [files]

Extract archive

rar x [archive.rar]

Extract to directory

rar x [archive.rar] [destination/]

List contents

rar l [archive.rar]

Add with password

rar a -p[password] [archive.rar] [files]

Add with compression level

rar a -m[5] [archive.rar] [files]

Test archive

rar t [archive.rar]

Add recovery record

rar a -rr[5%] [archive.rar] [files]

说明

rar creates and manages RAR archives. It provides high compression ratios and features like recovery records and solid archives. Compression levels range from 0 (store) to 5 (maximum). Higher levels take more time but produce smaller files. Recovery records protect against corruption. They add redundancy that can repair damage up to the specified percentage. Header encryption (-hp) hides filenames in addition to content. Standard password protection (-p) encrypts data but shows names. Volume splitting creates multi-part archives. Size can be specified in bytes, kilobytes, or megabytes. Solid archives compress files together, improving ratios for similar files. Extraction of single files requires processing earlier files.

参数

a
Add files to archive.
x
Extract with full paths.
e
Extract without paths.
l, v
List archive contents.
t
Test archive.
d
Delete from archive.
u
Update files.
-m _N_
Compression level (0-5).
-p _PASSWORD_
Set password.
-r
Recurse subdirectories.
-rr _N_
Add recovery record (percent).
-v _SIZE_
Create volumes.
-y
Yes to all queries.
-o+, -o-
Overwrite mode.
-hp _PASSWORD_
Encrypt headers too.

FAQ

What is the rar command used for?

rar creates and manages RAR archives. It provides high compression ratios and features like recovery records and solid archives. Compression levels range from 0 (store) to 5 (maximum). Higher levels take more time but produce smaller files. Recovery records protect against corruption. They add redundancy that can repair damage up to the specified percentage. Header encryption (-hp) hides filenames in addition to content. Standard password protection (-p) encrypts data but shows names. Volume splitting creates multi-part archives. Size can be specified in bytes, kilobytes, or megabytes. Solid archives compress files together, improving ratios for similar files. Extraction of single files requires processing earlier files.

How do I run a basic rar example?

Run `rar a [archive.rar] [files]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does a do in rar?

Add files to archive.