Unar
Unar is an archive unpacker supporting a wide variety of file formats including zip, RAR, 7z, tar, and many legacy formats. It includes lsar for listing archive contents and unar for extracting them.
Description
The Unarchiver provides tools to handle numerous archive formats, from modern ones like ZIP, RAR, 7z, tar, gzip, bzip2, LZMA, XZ, CAB, MSI, NSIS, EXE, ISO, BIN, and split files, to older formats such as Stuffit, ARJ, ARC, ACE, ZOO, and more. This makes it invaluable for unpacking files in forensic analysis, reverse engineering, or general file handling where diverse compression methods are encountered.
The package includes lsar, which lists archive contents with options for detailed information, integrity testing, password handling, and JSON output, and unar, which extracts contents with controls for output directories, overwriting, recursion, and encoding. These tools are particularly useful in cybersecurity tasks involving evidence recovery from archives or processing protected files.
Use cases include extracting archives during incident response, testing file integrity, or scripting batch operations on mixed-format collections. Dependencies ensure compatibility with GNUstep runtime and various compression libraries.
How It Works
Unar and lsar parse archive structures using format-specific handlers for supported compression and packaging methods like ZIP, RAR, 7z, tar variants, and legacy formats. They support password decryption, filename encoding detection or specification, integrity testing where possible, and handle nested archives unless recursion is disabled. Output modes include directory extraction, stdout streaming, JSON listings, and resource fork processing for Mac formats, leveraging libraries like libbz2, libicu, libgnustep-base, and zlib.
Installation
sudo apt install unarFlags
Examples
lsar -hlsar [options] archive [files ...]lsar -l archivelsar -p password archivelsar -j archiveunar -hunar [options] archive [files ...]unar -o directory archive