rar

最後更新: 2019-08-02

目錄

  • 安裝
  • 常用 Commands
  • Recovery Record
  • Comment

安裝

 

# 到 https://www.rarlab.com/download.htm 找合適版本

wget https://www.rarlab.com/rar/rarlinux-x64-5.6.1.tar.gz

tar -zxf rarlinux-x64-5.6.1.tar.gz

cd rar

make

mkdir -p /usr/local/bin
mkdir -p /usr/local/lib
cp rar unrar /usr/bin
cp rarfiles.lst /etc
cp default.sfx /usr/lib

ln -s /usr/bin/rar /usr/bin/rar

Help / License

rar | head

RAR 5.61   Copyright (c) 1993-2018 Alexander Roshal   30 Sep 2018
Trial version             Type 'rar -?' for help

Usage:     rar <command> -<switch 1> -<switch N> <archive> <files...>
               <@listfiles...> <path_to_extract\>

...

 


常用 Commands

 

a              # Add files to archive

i.e.

rar a ss64.rar music/

l[t[a],b]      # List archive contents [technical[all], bare]

e               # Extract files without archived paths

x                # Extract files with full path

p                # Print file to stdout

t                 # Test archive files

v[t[a],b]     # Verbosely list archive contents [technical[all],bare]

 


Recovery Record

 

rr[N]          # Add data recovery record

rv[N]          # Create recovery volumes

r                # Repair archive

# RAR 4.x recovery record is based on XOR algorithm. 'rr5p' for 5%

# RAR 5.0 recovery record uses Reed-Solomon error correction codes. 'rr5' and 'rr5p' mean 5%

If you use the plain 'rr' command without optional parameter,

WinRAR will set the recovery record size to 3% of archive size by default.
 

i.e.

# 為 backup.rar 加入 3% rr

rar rr backup.rar

# 把 Folder "20190621" 打包成 20190621.rar 並加入 3% rr

rar a rr 20190621.rar 20190621

 


Comment

 

c              # Add archive comment

z[file]       # Read archive comment from file

 

Creative Commons license icon Creative Commons license icon