unrar – Unzip RAR File Command, Extract Files from RAR Archive

The unrar command is a Linux utility tool used to extract files from RAR archives. It is used to unpack, extract, and decompress RAR files. RAR is a file format used for data compression and archiving. The unrar utility tool is used to extract files from these archives for use in other applications.

Overview

To use the unrar command, open a terminal and enter the following command:

unrar x archive.rar

This command will extract all files from the RAR archive named archive.rar into the current working directory.

Specific Use Cases

  • To extract a single file from a RAR archive, use the command:
  unrar e archive.rar file.txt

This command will extract the file named file.txt from the RAR archive archive.rar.

  • To extract files from a RAR archive into a specific directory, use the command:
  unrar x archive.rar /path/to/directory/

This command will extract all files from the RAR archive archive.rar into the directory /path/to/directory/.

  • To extract files from a password-protected RAR archive, use the command:
  unrar x -pPASSWORD archive.rar

This command will extract all files from the password-protected RAR archive archive.rar. Replace PASSWORD with the actual password for the archive.

Options

The unrar command has several options that can be used to modify the behavior of the command. The following table lists all available options for this command:

Option Description
x Extract files from the archive
e Extract files without preserving directory structure
pPASSWORD Specify a password for password-protected archives
v Verbose output
y Assume Yes to all queries

Troubleshooting Tips

  • If you receive an error message stating that the unrar command is not found, you may need to install the unrar package. You can install it using the following command:
  sudo apt-get install unrar
  • If you are having trouble extracting files from a RAR archive, make sure that you are using the correct password if the archive is password-protected.

Notes

  • The unrar command is not included in some Linux distributions by default. You may need to install it separately.
  • The unrar command can only be used to extract files from RAR archives. To create RAR archives, you will need to use a different tool, such as rar.