How to extract RAR file in Linux using command in Ubuntu Terminal. This tutorial explains how to open rar file in Linux Ubuntu command line.
To extract and open RAR files on Linux Ubuntu, we’ll use the unrar tool. In simple words, unrar is a commandline utility to list, test, or extract files from RAR.
The unrar command line application can be used for extracting compressed Roshal Archive (.rar) files on Unix-based operating systems, such as Linux, Ubuntu, Mint, CentOS, Kali Linux and others. The unrar command the following syntax:
unrar command [switches] archive {files | @listfiles} [path_to_extract]
To install unrar, open a terminal and run the following commands:
$ sudo apt-get install unrar
Install unrar on Ubuntu Linux using Source
On 64 Bit Systems
# cd /tmp # wget https://www.rarlab.com/rar/rarlinux-x64-623.tar.gz # tar -zxvf rarlinux-x64-623.tar.gz # cd rar # sudo cp -v rar unrar /usr/local/bin/
On 64 Bit Systems
# cd /tmp # wget https://www.rarlab.com/rar/rarlinux-x32-623.tar.gz # tar -zxvf rarlinux-x32-623.tar.gz # cd rar # sudo cp -v rar unrar /usr/local/bin/
Once installed, to open/extract a RAR file in a specific path or destination directory, just use the e option, it will extract all the files in the specified destination directory. the command will have the following usage sytnax:
$ unrar e sourcedigit.rar
If you want to extract files with full path, use the parmeter x with command as shown below:
$ unrar x sourcedigit.rar
If you want to extract all members of sourcedigit.rar into the current directory only, use the parameter e and if you want to test sourcedigit.rar, use the t command option. That’s the end of this tutorial.