LinuxCommandLibrary

unar

Universal multi-format archive extractor

TLDR

Extract archive

$ unar [archive.zip]
copy
Extract to directory
$ unar -o [output_dir] [archive.rar]
copy
Extract with password
$ unar -p [password] [encrypted.zip]
copy
Force overwrite
$ unar -f [archive.zip]
copy
Extract without directory
$ unar -D [archive.tar.gz]
copy
List contents only
$ lsar [archive.7z]
copy
Extract specific encoding
$ unar -e [shift_jis] [japanese.zip]
copy

SYNOPSIS

unar [-o dir] [-p password] [-e encoding] [options] archive

DESCRIPTION

unar extracts archives of many formats. It handles Zip, RAR, 7-Zip, tar, gzip, bzip2, ISO, and many legacy formats.
Format detection is automatic. The tool examines archive contents rather than relying solely on extensions.
Encoding handling processes international filenames correctly. Japanese, Chinese, Korean, and other encodings are supported and auto-detected.
Password handling works for encrypted archives. Both header-encrypted and content-encrypted formats are supported.
The tool handles broken or non-standard archives that other extractors reject. It attempts to recover what it can.
By default, archives extract to a directory named after the archive. This can be controlled with -d or -D options.

PARAMETERS

-o DIR

Output directory.
-p PASSWORD
Archive password.
-e ENCODING
Filename encoding.
-f, --force
Overwrite without asking.
-D, --no-directory
Don't create containing directory.
-d, --directory
Always create directory.
-k MODE
How to handle existing files.
-q, --quiet
Quiet mode.
-t, --test
Test archive.
-nr, --no-recursion
Don't extract nested archives.
-h, --help
Show help.

CAVEATS

Not installed by default. Some formats have limited metadata support. Very old formats may have quirks.

HISTORY

unar is part of The Unarchiver, created by Dag Ă…gren starting around 2006. Originally a macOS GUI application, command-line tools were added later for scripting.

SEE ALSO

lsar(1), unzip(1), unrar(1), 7z(1), tar(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community