rar and unrar archives in linux

Rar archived files are very common these days and we have a solution for rar file extraction and compression in linux. To extract rar files we have the unrar application.

To use unrar to extract use the following commands:
unrar e <filename.rar> use this to unpack the rar file in current directory
unrar l <filename.rar> use this to list the files inside the archive
unrar x <filename.rar> use this to extract the files with the full path
unrar t <filename.rar> use this to test the integrity of archive

Now for those who wish to compress files into the rar archived format, we have the rar application and the following commands will come in handy:

rar a <desired filename.rar> <path of directory to archieve> use this to create a normal compressed rar archieve
rar a <desired filename.rar> <path to file1> <path to file2> <path to file3> … use this more multiple individual files to be archived into a sigle rar file.
rar a -p<password> <desired filename.rar> <path to dir or file> use this to password protect the rar files
rar a -m<level of compression 1-least 5-best> -v<size of each rar file> <desired filename.rar><path to dir or file> use this to split the file to a number of rar archived files of desired size.

Now to get all this and install the rar and unrar application, proceed with the following commands:

wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz
tar -zxvf rarlinux-3.6.0.tar.gz
cd rar
cp rar unrar /bin

Comment Form

About this blog

This blog, acts as a knowledge repository for the world and is unofficial! Anything we find interesting in the cyber world will go here. Most cases, this blog will reflect the happiness of our staff in reaching successful solution to an issue (s)he worked on. A reference for other fellow SAGEs who come across similar issues later