How To Open and Extract RAR Files In Linux?

How To Open and Extract RAR Files In Linux?


This post was last updated on August 1st, 2020 at 01:14 pm

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


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

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.


Now if you want to explore more options that can be used with the unrar command then see its manual page by using-

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

Linux Topics 0 Comments

How To Kill A Running Process In Linux/Unix?

This post was last updated on August 1st, 2020 at 12:44 pmIn Linux, a process is an instance of a program that is running on a computer. When a program

Linux Topics 0 Comments

How To Install & Use Cockpit Web Console On Ubuntu Server?

The cockpit is a web console that makes it easy to administer the GNU/Linux server. It has a user-friendly web-based interface that enables you to carry out different system admin

Linux Topics 0 Comments

Package Management In Debian(.deb) Based Linux Distributions

This post was last updated on August 3rd, 2020 at 03:04 pmContents1 Software Package2 Package Manager3 Advanced Packaging Tools (apt)3.1 apt-get Commands-3.2 apt-cache Commands-3.3 Difference between apt and apt-get commands-4


No Comments Yet!

You can be first to comment this post!

Leave a Reply