$linuxjunkies
>

unrar(1)

Extract, test, and list files from RAR archives.

UbuntuDebianFedoraArch

Synopsis

unrar [OPTION]... ARCHIVE [FILE]...

Description

unrar extracts files from RAR archives, a proprietary compression format. It supports RAR4 and RAR5 archive formats and can list archive contents, test integrity, and extract with optional password protection.

By default, unrar extracts files to the current directory, preserving the original directory structure stored in the archive. Use flags to control extraction behavior, such as overwriting, path handling, and password input.

Common options

FlagWhat it does
xExtract files with full path (recreates directory structure)
eExtract files to current directory (ignores paths in archive)
tTest integrity of archive files without extracting
lList archive contents in short format
lbList archive contents in bare format (filenames only)
-p PASSWORDSupply password for encrypted archive
-o+Overwrite existing files without prompting
-o-Skip existing files without prompting
-rRecursively extract from nested archives
-vList files in verbose format with detailed information
-c-Disable comments display
-yAssume yes to all prompts

Examples

Extract all files from archive.rar, preserving directory structure

unrar x archive.rar

List contents of archive.rar without extracting

unrar l archive.rar

Test integrity of archive.rar and verify all files are readable

unrar t archive.rar

Extract password-protected archive.rar with the given password

unrar x -p mypassword archive.rar

Extract all files to /tmp/ directory, ignoring original paths

unrar e archive.rar /tmp/

Extract only specific files from archive.rar

unrar x archive.rar document.txt image.jpg

Extract archive.rar, overwriting any existing files

unrar x -o+ archive.rar

List files with verbose details including compression ratios

unrar v archive.rar

Related commands