How To Open and Extract RAR Files In Linux?

How To Open and Extract RAR Files In Linux?

 
 

Like other archives, a RAR file is a data container that stores one or several files in compressed form. RAR is a proprietary file format which is developed by Eugene Roshal. It is a native file format for the WinRAR archiver. RAR file uses .rar file extension. It is frequently used on Windows OS. If you downloaded a .rar file then first you need to extract it with an application that supports RAR file format and then you can use it. WinRAR application is not available for Linux instead of it we can use rar and unrar programs to create, extract RAR archives. Ahead in this article, we will discuss how you can extract the RAR file in Linux.

How to Install unrar?

Unrar is an application used to extract .rar files in Linux and Unix. Before you start extracting RAR files you need to install it on your system-

If you are using a Debian based distribution such as Ubuntu, Linux Mint, etc then use –

sudo apt install unrar

or

sudo apt-get install unrar

Or if you are using an rpm-based Linux distribution such as centos, Redhat, etc then use –

sudo yum install unrar
sudo yum install unar

(this is unar and not unrar)

To install it in Fedora use –

sudo dnf install unrar

Now, unrar is installed and ready to use in your system.

List the files inside the archive

Unrar is installed now before we start extracting rar files we will use a command to list the files that are inside an archive file. To display the list of files and directories use the following command in the terminal. Here, I will extract sample.rar which contains some files inside it –

unrar l sample.rar

Extract the RAR archive

To extract or open a rar file in the current working directory use the unrar command with option e. Now execute the following command to extract the sample.rar file from the terminal –

unrar e sample.rar

Press y if it displays options like given in the image above. This will extract all the files inside the current working directory.

Extract the RAR archive with the original directory structure

If you want to extract files with original directory structure then use the x option with unrar command in the terminal. Use the following command –

unrar x sample.rar

This command will first create the directory named sample and then extract the files inside it.

Conclusion

Now if you want to explore more options that can be used with the unrar command then see its manual page. To see the manual page use the following command in the terminal –

man unrar

If you have any thoughts related to this article, share it with us in the comments below.

 

Previous How To Set Password On A RAR Archive In Linux?
Next How To Create RAR Archive In Linux?

About author

You might also like

Uncategorized 0 Comments

How To Install PyCharm In Linux Mint?

The PyCharm is a fully-featured IDE for python. It is developed by JetBrains. PyCharm supports many other programming languages such as HTML, CSS, Javascript, SQL, etc. The features of PyCharm

Uncategorized 0 Comments

How To Create RAR Archive In Linux?

Like other archives, a RAR file is a data container that stores one or several files in compressed form. RAR is a proprietary file format which is developed by Eugene

Uncategorized 0 Comments

How To Display List of Installed Packages In Debian, Ubuntu And Linux Mint?

One of the important tasks of a system administrator is to analyze, install or remove packages on a system. Advanced package tool or apt is a package manager that is

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply