How to unrar multiple .rar files using bash?
You might need the package: unrar
You can check your server using the following command if you have already installed it or not.
user@server:$ rpm -q unrar
If nothing shows up, install the package unrar. If you are using a Linux OS which uses yum update you can use the following command to install it.
user@server:$ yum install unrar
If that does not work for you, you can simply install it manually using the next commands.
user@server:$ wget http://www.rarlab.com/rar/unrar-3.7.7-centos.gz
gzip -d unrar-3.7.7-centos.gz
chmod +x unrar-3.7.7-centos
cp unrar-3.7.7-centos /usr/bin/unrar # Need to do this as admin
gzip -d unrar-3.7.7-centos.gz
chmod +x unrar-3.7.7-centos
cp unrar-3.7.7-centos /usr/bin/unrar # Need to do this as admin
When that is all done, we can start using unrar. If you want to unrar multiple .rar files at once, you may use this command.
user@server:$ find -type f -name '*.rar' -exec unrar x {} \;

Comments
Thanks a lot, been struggling for an hour on how to do it. It works perfectly!
Juraj Belina
Thank you very much. I was searching all the web trying to unrar multiple files with password until I found your page. You’re great.
Oscar