How to Open RAR Files in Linux using Unrar
How to Open RAR Files in Linux using Unrar
If you want to open a RAR file on Linux, it's easy—you'll just need to use the Unrar command. While most Linux distributions, including Ubuntu, don't come with Unrar, you can easily install it using your distro's package manager. Once installed, use the command unrar x to extract all files and directories from the RAR archive. This wikiHow article will teach you how to unrar files on Linux using the Unrar command.
Things You Should Know
  • You can usually install Unrar using your Linux distribution's package manager. On Ubuntu, use sudo apt-get install unrar.
  • To unrar files, use the command unrar x filename.rar.
  • To unrar to a specific directory, use unrar x filename.rar /path/to/directory.

Installing Unrar

Debian & Ubuntu. Unrar, which is the Linux command line version of the popular WinRAR app, is easy to download with apt-get. Type sudo apt-get update and press Enter. Type sudo apt-get install unrar and press Enter.

Redhat, CentOS, & Fedora. On Redhat-based Linux distros, you can use dnf to install the Unrar package. Type sudo dnf upgrade and press Enter. Type sudo dnf install unrar and press Enter.

Arch Linux. You can use pacman to install Unrar: Type pacman -Syu and press Enter. Type pacman -S unrar and press Enter.

OpenSUSE. You can use zypper to install Unrar: Type zypper refresh and press Enter. Type zypper install unrar and press Enter.

Downloading the binaries. Some distributions may not have Unrar in their repositories because the software isn't open source. If you can't find Unrar in your distro's package manager, you can download the source code and install it easily: First, download the latest version of RAR using this command: x64: wget https://www.rarlab.com/rar/rarlinux-x64-621.tar.gz x86: wget https://www.rarlab.com/rar/rarlinux-x32-621.tar.gz You can double-check the latest version at https://www.rarlab.com. Untar and unzip the downloaded file: x64: tar -zxvf rarlinux-x64-621.tar.gz x86: tar -zxvf rarlinux-x32-621.tar.gz Enter the new directory called rar by typing cd rar and pressing Enter. Type sudo make and press Enter. This copies the Rar and Unrar binaries to /usr/local/bin.

Using Unrar

Use unrar x filename.rar to unrar the file. When you use the x option, you'll preserve the directory structure (folders and subfolders) when extracting the files. This command will extract all files and folders from the RAR file to the current directory. If you want to extract the files to a different directory, use unrar x filename.rar /path/to/directory. If the RAR file requires a password, you'll be prompted to enter it. Many RAR files are protected by passwords for security purposes.

Use unrar e filename.rar to extract files without preserving directories. If you want all files from the archive to be extracted to the same location instead of keeping the directory structure in which they were compressed, use this option. In most cases, it's better to use the x option instead. You can specify the directory you want to extract the file to with unrar e as well. E.g., unrar e myfile.rar /usr/local/bin If you have a RAR file that came with multiple parts (e.g., .rar, .rar.00, .rar.01), you'll only need to use the above command on the first file (the one ending in .rar). This will extract the files from the RAR's other parts.

Use unrar l filename.rar to list files and directories in the archive. If you want to see what's inside the RAR file before extracting the files, you can use this command to view the files and structure.

Use unrar t filename.rar to test the integrity of a file. This checks the structure of the RAR archive and displays the results.

What's your reaction?

Comments

https://umatno.info/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!