Linux Rar File

broken image


RAR files can be created only with commercial software WinRAR (Windows), RAR for Android, command-line RAR (Windows, MS-DOS, macOS, Linux, and FreeBSD), and other software that has written permission from Alexander Roshal or uses copyrighted code under license from Roshal. The software license agreements forbid reverse engineering. To extract rar file in CentOS 7, We need to install package called unar (Not unrar), Then we can extract rar files using the unar utility. Install unar on CentOS. Extract rar files with unar. Extract Password Protected rar files.

When it comes to handling zip files, Windows users have always had the advantage with WinRAR that automatically helps to extract and compressing zip files. On the other hand, in case of Linux operating systems, users have to either download other compatible tools or perform the operation through command terminal.

What is a .RAR File Extension?

For users who don't know, a RAR file is a compressed file that is split into a set of multi-volume files. This is usually done in cases where there are large file sets that are needed to be shared or transferred, hence are compressed into a zip file. Similarly, for zip files, when they are transferred or downloaded from the internet need to be extracted. A number of tools are available to help extract and compress these files within seconds, regardless of their size or quantity.

Extracting RAR Files in Linux distributions

Rar

RAR is a free tool that is pre-installed on Windows operating systems but unfortunately doesn't support Linux platforms. If you will try extracting in Ubuntu, the archive manager will show you the following dialogue box:

This is because the system won't recognize the file type like Windows and does not have any supported tool to extract it. In other cases, it will also display an error somewhat like this:

Read on below to find out how you can install RAR tools on Linux and use those to open, extract, and compress a file.

How to Install Unrar tool in Linux

Unrar is compatible mostly for Linux distributions where you can easily install the package from the command terminal using the apt programs.

Open Command Terminal and type the following command(s) if you're using Ubuntu or Debian based distros:

Or

If you are using Fedora distro, type the command in your command prompt:

For users using CentOS/ RHEL 64-bit distros, you can install the Unrar tool using these commands:

$ cd/tmp
$ wget https://www.rarlab.com/rar/rarlinux-x64- tar.gz
$ tar –zxvf rarlinux-x64-tar.gz
$ cd rar
$ sudocp –v rar unrar /usr/local/bin/

(Just remove ‘x64' from the above command if you want to alter it for 32-bit systems)

How to Extract a RAR File in Linux

To open or extract a .rar extension file in your current working directory, type the following command in the terminal:

Online text editor like sublime. This will start extracting your file using the Unrar tool like this below:

Note: Since you have the Unrar tool, you can also perform these operations directly through the right click, besides using these commands on the terminal.

To open or extract a .rar extension file in any specific path or directory, type the following command in the terminal. This will extract the files and locate them in the specified directory.

If you want to open or extract a .rar extension file in their original directory, use the following command:

How to View Contents inside a RAR File in Linux

Cyber movie editor. A compressed file contains multiple files of large sizes that are zipped together inside it. If you want to list out all the file contents inside an archive file, use the command below. This will display a list of files with their name, size, time, date created and permissions.

Testing a RAR File in Linux

If for instance, you have downloaded a file from the internet and would like to test its integrity, the Unrar tools offers that too. The following command will do a complete check on the archive file and its contents, and then show the results. Type:

The unrar tool that we just downloaded uses the unrar command to carry out the above tasks. It lets you extract, list out and test files. There is no option for creating a rar file with this particular tool. Therefore, we will install another Linux command-line utility called RAR to create compressed/archive files.

Installing RAR in Linux

To install the RAR command option, type the following commands in the terminal:

Linux Rar File

RAR is a free tool that is pre-installed on Windows operating systems but unfortunately doesn't support Linux platforms. If you will try extracting in Ubuntu, the archive manager will show you the following dialogue box:

This is because the system won't recognize the file type like Windows and does not have any supported tool to extract it. In other cases, it will also display an error somewhat like this:

Read on below to find out how you can install RAR tools on Linux and use those to open, extract, and compress a file.

How to Install Unrar tool in Linux

Unrar is compatible mostly for Linux distributions where you can easily install the package from the command terminal using the apt programs.

Open Command Terminal and type the following command(s) if you're using Ubuntu or Debian based distros:

Or

If you are using Fedora distro, type the command in your command prompt:

For users using CentOS/ RHEL 64-bit distros, you can install the Unrar tool using these commands:

$ cd/tmp
$ wget https://www.rarlab.com/rar/rarlinux-x64- tar.gz
$ tar –zxvf rarlinux-x64-tar.gz
$ cd rar
$ sudocp –v rar unrar /usr/local/bin/

(Just remove ‘x64' from the above command if you want to alter it for 32-bit systems)

How to Extract a RAR File in Linux

To open or extract a .rar extension file in your current working directory, type the following command in the terminal:

Online text editor like sublime. This will start extracting your file using the Unrar tool like this below:

Note: Since you have the Unrar tool, you can also perform these operations directly through the right click, besides using these commands on the terminal.

To open or extract a .rar extension file in any specific path or directory, type the following command in the terminal. This will extract the files and locate them in the specified directory.

If you want to open or extract a .rar extension file in their original directory, use the following command:

How to View Contents inside a RAR File in Linux

Cyber movie editor. A compressed file contains multiple files of large sizes that are zipped together inside it. If you want to list out all the file contents inside an archive file, use the command below. This will display a list of files with their name, size, time, date created and permissions.

Testing a RAR File in Linux

If for instance, you have downloaded a file from the internet and would like to test its integrity, the Unrar tools offers that too. The following command will do a complete check on the archive file and its contents, and then show the results. Type:

The unrar tool that we just downloaded uses the unrar command to carry out the above tasks. It lets you extract, list out and test files. There is no option for creating a rar file with this particular tool. Therefore, we will install another Linux command-line utility called RAR to create compressed/archive files.

Installing RAR in Linux

To install the RAR command option, type the following commands in the terminal:

$ sudoapt-get install rar
$ sudo dnf install rar
$ yum install rar

Rar File Opener For Windows 10

After you execute the commands, the result will be:

Creating RAR Files in Linux

In order to create a .rar file in Linux distribution, you will need to run the following command:

This will create an archive file name ‘filename' for the directory filename1. See how this will look like below:

Deleting Files from any Archive

Out of the multiple files in an archive, if you want to delete a particular file through the command terminal, type the following command:

Recovering deleted Archives

If you deleted an archive file by accident or lost it through data loss, don't worry, you can always recover it back. The following command will recover the file back or will fix it if there has been any loss or damage.

Linux Rar File

Setting password on a Particular Archive

This incredible Rar tool lets you do a number of interesting things with your archive files from creating, deleting, and adding, to changing their directories and protecting them through passwords.

If you want to protect your files from unknown access or extraction, you can set a password on them. To password-protect your file, type the following command:

Now, to verify the changes, type the command to open the directory to see if it asks for password.

Wrap Up

RAR and UNRAR are very useful when it comes to handling and managing files in Linux. They provide multiple options to make your work easier and more convenient. When compared to Windows, things get a little complicated for Ubuntu, but these commands are simple, easy to execute and give results within seconds.

If you need more description on the commands, just the run the following two:

How to Extract rar Files in CentOS Linux

In this tutorial we are going to learn how to unrar .rar files in CentOS 7 using unar utility.

To extract rar file in CentOS 7, We need to install package called unar (Not unrar), Then we can extract rar files using the unar utility.

Install unar on CentOS Linux

The unar for CentOS 7 provides by the epel repository, So first enable the epel repository.

Then install unar on CentOS using yum command.

3ds emulator animal crossing new leaf. yum install unar

Don't misspell the package name, it is unar not unrar.

Extract rar files in CentOS with unar

To extract .rar archive file from the command line, execute unar command followed by the name of the archive file.

By default archive file will extract to the current working directory. To extract rar file to a different directory, we need to use -o option.

unar -o /opt example.rar

As per the above command The .rar archive example.rar will unrar to the /opt directory.

Unrar Password Protected rar files in CentOS

By default unar command will prompt the password if the rar file is password protected.

Unzip Rar File Linux

Or we can specify the password with -p option.

unar -p 123456 centos.rar

Extract rar files in CentOS Desktop

When we have unar package installed, we can unrar archive files from the GUI.

To unrar a archive file using the GUI, Right click on the .rar file and select Extract Here.

Summary

In this tutorial we learned how to extract .rar archive format in CentOS 7.

Open Rar File Linux

  • In Order to Unrar .rar files, we need to install unar package which is provided by the epel repository for CentOS 7.
  • Once we install unar, we can extract archive files using both command line and the GUI.




broken image