Javatpoint Logo
Javatpoint Logo

Extract RAR File in Ubuntu

What is RAR File?

RAR is the proprietary archive file format that provides its support for file spanning, error recovery, and data compression. In 1993, it was developed by Eugene Roshal (a Russian software engineer) and the software was licensed via win.rar. The RAR term is an abbreviation for Roshal Archive.

A RAR file is an archive that includes multiple files compressed using RAR compression. It's compressed using a high compression ratio as compared to a typical ZIP compression and consolidates an algorithm of proprietary compression used by other compressors such as 7-Zip for 7Z files. RAR archives are often used for transferring or storing files since they store files in a decreased size.

  • Also, RAR files may be extracted and compressed with a range of utilities while they are typically made by WinRAR.
  • Often, RAR files are used for storing the files or groups of files that are bigger in sizes like a video file or camera raw file.
  • We may encounter the RAR file by email from a friend or co-worker looking for sharing files or we may download the content in the RAR archive using a website.
  • We can assume a RAR file is like a normal folder on our computer in which there are sometimes several other folders and files in it for the purpose of managing them.
  • However, a RAR file requires special software for opening and extracting the contents, unlike a regular folder.

Note: Almost all file extensions can be pronounced as their single letters but RAR is treated as a term itself and called "Rahr".

File Format of RAR

The RAR filename extensions are .rev for recovery volume set and .rar for data volume set. Older RAR versions split bigger archives into many smaller files and make a "multi-volume archive". Also, the numbers were utilized in the smaller file's file extensions for keeping them in an accurate order. The first file utilized the .rar extension, then the .r00 extension for the second, and then the .r01, .r02 extensions, etc.

RAR compression libraries and applications (including GUI-based application of WinRAR for Windows and console utility for distinct operating systems and others) are the proprietary programs, to which Alexander L. Roshal owns the copyright. RAR version 3 is based on PPM (Prediction by Partial Matching) and Lempel-Ziv compression.

The minimum RAR file size is 20 bytes and the maximum size is 9,223,372,036,854,775,807 bytes which are 9000 PB.


The revision history of the RAR file format:

Extract RAR File in Ubuntu
  • 1.3: It is the first public release and doesn't have the signature, i.e., "RAR!".
  • 1.5: Modifications are not known.
  • 2.0: This version was released with Rar for MS-DOS 2.0 and WinRAR 2.0. Some aspects are below:
    • Introduces record of archive data recovery protection.
    • Compression dictionary of Up to 1 MB.
    • Multimedia compression for uncompressed audio and true color bitmap images.
  • 2.9: It was released in the 3.00 version of WinRAR. Feature modifications in this version are as follows:
    • Encryption of both file headers and file data. Develops compression algorithm with the dictionary size of 4 MB. PPMII algorithm of Dmitry Shkarin for file data.
    • Supports archive files bigger than 9 GB.
    • Optional "recovery volumes" (.rev files) creation with redundancy data that can be used for constructing missing files inside a volume set.
    • Supports Unicode file names which are stored inside the format of UTF-16 little-endian.
  • 5.0: This version was supported by the 5.0 and later versions of WinRAR. Modifications in this version are as follows:
    • The maximum compression size of a dictionary increased to 1 GB.
    • The maximum length of the path for files in ZIP and RAR achieves is increased up to 2048 characters.
    • Faster decompression and compression
    • Supports Unicode file names which are stored in the format of UTF-8.
    • Improves recovery greatly.
    • Supports multicore decompression.
    • Optional detection of duplicate files.
    • Optional symbolic and NTFS hard links.
    • Optional file hash, i.e., 256-bit BLAKE2 rather than a 32-bit CRC32 file checksum (default).
    • AES encryption (optional) increased from 128-bit to 256-bit.
    • Remove algorithms of specialized compression for Itanium executables, raw image files, raw audio, and text; consequently, a few files of these kinds compress better in the previous RAR format using these options enabled as compared in RAR5.

Extract RAR files in Ubuntu

RAR is a tool that is freely available and pre-installed on Windows OSes but unfortunately does not support the platform of Linux. If we will attempt extracting on Ubuntu, the archive manager will display us a dialogue box.
It is due to the system would not identify the file type such as Windows and doesn't have the supported tools for extracting it. In some other cases, it will show an error as well.

We can go through the following methods to see how we can install the tools of RAR in Ubuntu and use those to create, extract, and compress the files.

Installing Unrar tool in Ubuntu

Unrar is mostly compatible with Linux distributions where we can easily install a package using the command terminal with the apt programs.

  • We need to open the terminal window and enter the below command if we are using Debian or Ubuntu-based distributions:

Extract RAR File in Ubuntu
  • If we are using the Fedora distribution, we can use the following command in the terminal window:
  • If we are using RHEL/CentOS 64-bit distribution, we can use the following command in the terminal window:

Extract RAR File in Ubuntu

(We can delete "x64" from the command if we wish to edit it for a 32-bit system.)

How to install RAR in Ubuntu

We need to enter the below commands in the terminal window for installing the RAR command option:

Extract RAR File in Ubuntu

How to create RAR files in Ubuntu

We will need to execute the below command for creating a .rar file in Ubuntu:

It will establish a 'filename' archive file name for the filename1 directory.

How to remove files from an archive

If you want to remove a specific file out of more than one file within an archive, we need to enter the below command in the terminal window:

How to recover removed archives

If we removed an archive file mistakenly or lost it by data loss, do not worry because we can recover it. The below command will recover that file or will set it if there has been any damage or loss:

Extract RAR file

We need to enter the below command in the terminal Window for opening or extracting a .rar extension file in our current working directory.

It will begin extracting our file with the help of the Unrar tool.

Important: We can also implement these operations with the right-click, besides applying these commands in the terminal window because we have the tool, i.e., Unrar.

We need to enter the below command in the terminal window for opening or expecting a .rar extension file in any particular directory or path. It will extract those files and place them in that directory:

If we wish to open or extract the .rar extension files in their actual directory, we can use the below command:

Viewing content in a RAR file in Ubuntu

A compressed file includes more than one file of bigger sizes that are zipped inside it together. If we wish to list out every file content in an archive file, we can use the following command. The command will show a file list with their name, time, size, permissions, and date created.

How to test a RAR file in Ubuntu

If we have downloaded any file for instance through the internet and wish to check its integrity, the Unrar tool provides that facility as well. The below command will do a full test on the archive file and then display the results:

The tool, i.e., unrar that we just installed applies the unrar command for carrying out the above operations. It enables us to extract, test, and list out the files. Options to create a rar file are not available with this specific tool. Hence, we will install other Linux command-line utilities which are known as RAR for creating archive/compressed files.

Next TopicForticlient Ubuntu

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA