RAR is a proprietary archive file format that supports data compression, error recovery and file spanning. A
.rar file may contain one or more files or directories.
rar utility is used to compress file(s) and
unrar to extract.
.rararchive from file(s):
rar a archive.rar file1 file2
Note: the same command is used to add new files to existing archive.
-rto include all dirs/files under the parent directory.
-pto encrypt file data.
-hpto encrypt both file data and headers.
-rr10to add recovery records to the archive. This way up to 10% of the compressed archive can become corrupt or unusable, and it will be able to recover the data through parity.
.rararchive from file, while specifying the compression level (0 being worst, 5 best, and 3 default). For example, level 4:
rar a -m4 archive.rar file1
Extract file(s) from archive:
unrar x archive.rar
Extract file(s) to specific directory:
unrar x archive.rar /home/$USER/Documents
Extract file(s) from archive to stdout:
unrar -p archive.rar
List all files in
unrar l archive.rar
vinstead for verbose output.
Remove file(s) from archive:
rar d archive.rar file2
Test compressed archive data (
unraralso can be used):
rar t archive.rar
You can find all
unrar options in man pages:
man rar man unrar