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

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

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 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 Setup Xfce Desktop Environment On CentOS 8?

Xfce is a free and opensource desktop environment that aims to be lightweight, fast, and low on system resources while still being visually appealing and easy to use. Like GNOME,

Linux Topics 0 Comments

How To List All The Users In A Linux Or Unix System?

This post was last updated on August 1st, 2020 at 03:21 pmLinux is a multi-user operating system. It means more than one user can use system resources simultaneously. To use

How To 0 Comments

How To Install And Configure KDE In FreeBSD?

This post was last updated on August 1st, 2020 at 10:31 amKDE is among one of the most popular free and opensource desktop environments. It provides various built-in tools. KDE

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply