Files with a .rar extension are compressed archives, much like a .tar.gz or .zip file. It is one of many file compression formats that rose to popularity over the years, but requires its own utility to use.
You may have an individual .rar archive such as
file.rar, but RAR archives are also known for being split into multiple files, such as
file.r01, etc. In these cases, it’s necessary to open the
file.rar file, which will then automatically combine the rest of the files into a single archive and extract its contents.
In this guide, you will see the step by step instructions for how to extract files from a RAR archive on Fedora Linux. This will work whether you have an individual .rar file or an archive that has been split into a sequence of files.
In this tutorial you will learn:
- How to install unrar utility on Fedora
- How to use unrar utility to open rar files
- How to unrar individual files
- How to view the contents of a rar file
- How to unrar files to a specific directory
|Requirements, Conventions or Software Version Used
|Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
Install Unrar Utility
Fedora Linux is not able to open
.rar files by default. In order to unrar, you will need to install a small utility. Open a command line terminal and type the following commands to install it:
$ sudo dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm $ sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm $ sudo dnf install -y unrar
Once the utility has finished installing, you will have access to the
unrar command and can use it with the syntax examples from the next section.
How to open rar files on Fedora – command examples
- Now that the unrar utility is installed, you can use the following command syntax with the
xoption to extract files from a RAR archive into your current working directory.
$ unrar x files.rar
- You can also specify a different directory after the archive name if you wish to extract the files somewhere else.
$ unrar x files.rar /path/to/dir
- If you would like to see the contents of the RAR archive, without extracting any files, use the
$ unrar l files.rar
- Now that you know the file names inside the archive, you can extract them individually if you would like. For example, this command would extract one text file from our example RAR archive.
$ unrar x files.rar file1.txt
- You can also specify multiple files to extract, if you would like to.
$ unrar x files.rar file1.txt file2.txt
That’s all there is to it. You may also be interested in our guide about creating compressed archives using RAR.
In this tutorial, we saw how to extract files from a RAR archive on Fedora Linux. The process is very simple once you install the unrar utility and know the correct switches to use with the command.