Unar in Termux – Extract ZIP, RAR and Other Archives

Unar is a command-line archive extraction tool that lets you extract files from different archive formats in Termux. It supports password-protected archives and provides options to control where files are extracted. You can also choose how to handle existing files, filenames, and nested archives.

Here’s what you can do with Unar tool in Termux:

  • Extract files from different archive formats.
  • Extract files into a specific directory.
  • Extract password-protected archives.
  • Overwrite existing files during extraction.
  • Extract selected files from an archive.
  • Handle different filename encodings.
  • Extract nested archives or disable recursive extraction.

Install Unar in Termux

Below is the command to install Unar tool in Termux using the Termux package manager. Simply copy and paste it into your Termux terminal.

First, update and upgrade the packages:

pkg update && pkg upgrade -y

Install Unar:

pkg install unar -y

Now unar is ready to use in Termux.

Use Unar in Termux

You can use the following commands to extract archive files and control different Unar features in Termux.

Display the help menu:

unar --help

Extract an archive:

unar archive.zip

Extract an archive into a specific directory:

unar -o /sdcard/Download archive.zip

Extract an archive and overwrite existing files:

unar -f archive.zip

Rename files when they already exist:

unar -r archive.zip

Skip files that already exist:

unar -s archive.zip

Always create a separate directory for extracted contents:

unar -d archive.zip

Extract files without creating a separate directory:

unar -D archive.zip

Extract a password-protected archive:

unar -p YOUR_PASSWORD archive.zip

Extract specific files from an archive:

unar archive.zip file.txt

Extract selected files using their indexes:

unar -i archive.zip 1 2

Disable extraction of nested archives:

unar -nr archive.tar.gz

Copy the archive’s modification time to the created directory:

unar -t archive.zip

Run Unar in quiet mode:

unar -q archive.zip

Show the installed version:

unar -v

These commands let you extract archives and manage files with different options in Termux.

End Note

Unar is a simple tool for extracting different archive files in Termux. It provides useful options for handling passwords, choosing extraction folders, and managing existing files.

SHARE THIS POST: