unrar file with password in linux

How to Unrar Files with Password in Linux

Sometimes the creator/sender of rar files would have set password to protect it from unauthorized users. So you may need to unrar password protected files or folder with password. Here is how to unrar password protected rar file in Linux. You can use these steps for all Linux distributions such as Ubuntu, Debian, Redhat, CentOS, Fedora.

How to Unrar Files with Password in Linux

It is very easy to unrar files with password in Linux. You just need to supply the password along with -p option.

Unrar single file with password

Open terminal and run the following command to unrar file with password. Replace /home/file.rar with your rar file’s path. Also replace <password> with your file’s password.

$ sudo unrar -p<password> /home/file.rar

Unrar multiple files with password

If you have multiple rar files with same password, you can use a for loop as shown below. Replace /home/*.rar with folder containing all your rar files

for file in/home/*.rar; do sudo unrar x -p<password> ${file}; done;

Unrar multipart file with password

If you have a multipart rar file with password, then you need to unrar only the first part with password, and unrar will automatically extract and combine the remaining parts with it. Replace /home/file01.rar with the first file of your multipart rar file.

$ sudo unrar -x -p<password> /home/file01.rar

That’s it. In this article, we have looked at how to unrar files with password, whether it is single, multiple or multipart files.

Also read:

How to Extract Multipart File in Linux
How to Unrar Multiple Files
How to Find Recently Modified Files in Linux
How to Install VNC Server in Linux
How to Redirect Wildcard Subdomain to Root Domain in Apache

Leave a Reply

Your email address will not be published.