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.
yum install epel-release
Then install unar on CentOS using yum command.
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.
unar example.rar
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.
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.
- 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.