Working with .rar files in Linux

Usually I don’t face .rar files and if I did, there were many online websites that would handle those files for me. But finally i got to this point that I need to take care of these files my self because of security issues and sometimes the size of files (sometimes more than 50MB per file). so I dived into finding the best solution.

There are many Linux based application out there that you can try, some will provide you GUI and some has TUI and some of theme have both. In this article i’m going to introduce the most suitable application I found:

First of all, I want to list applications I went through:

  • dtrx
  • p7zip
  • unrar

Among all these, I found unrar the most suitable from different aspects such as ease of installation and ease of use, though the other two cover more file¬†extensions. The only point about unrar is it has no GUI and you should work with terminal ūüėÄ

I will follow the following steps, so if you wish, you can jump to the section you prefere:

  1. Installation process
  2. Basic usage function
  3. Full commands description

 

1. Installation process

This step can be done in two ways, easy way by using packet-manager of your Linux, and hard way by installing the package manually. First I’m going to describe the easy way:

For Fedora, Centos and Redhat (Didn’t work for me on Fedora 17, so I used installing it manually):

yum install unrar

For Debian or Ubuntu users:

apt-get install unrar

Manual Install:

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

2. Basic usage commands

This application is so easy to use, just open the terminal and type the following codes ūüėČ

for extracting MyFile.rar:

unrar e MyFile.rar

for listing the rar content:

unrar l MyFile.rar

 

3. Full commands description

The following text can be found in the unrar package which contains all the information you need for operating with unrar, ust type the following command:

unrar

UNRAR 3.60 freeware    Copyright (c) 1993-2006 Alexander Roshal

Usage: ¬† unrar <command> -<switch 1> -<switch N> <archive> <files…>
<@listfiles…> <path_to_extract\>

<Commands>
e        Extract files to current directory
l[t,b]   List archive [technical, bare]
p        Print file to stdout
t        Test archive files
v[t,b]   Verbosely list archive [technical,bare]
x        Extract files with full path

<Switches>
Р       Stop switches scanning
ad       Append archive name to destination path
ap<path> Set path inside archive
av-      Disable authenticity verification check
c-       Disable comments show
cfg-     Disable read configuration
cl       Convert names to lower case
cu       Convert names to upper case
dh       Open shared files
ep       Exclude paths from names
ep3      Expand paths to full including the drive letter
f        Freshen files
id[c,d,p,q] Disable messages
ierr     Send all messages to stderr
inul     Disable all messages
kb       Keep broken extracted files
n<file>  Include only specified file
n@       Read file names to include from stdin
n@<list> Include files in specified list file
o+       Overwrite existing files
o-       Do not overwrite existing files
or       Rename files automatically
ow       Save or restore file owner and group
p[password] Set password
p-       Do not query password
r        Recurse subdirectories
sl<size> Process files with size less than  specified
sm<size> Process files with size more than  specified
ta<date> Process files modified after <date> in YYYYMMDDHHMMSS  format
tb<date> Process files modified before <date> in YYYYMMDDHHMMSS  format
tn<time> Process files newer than <time>
to<time> Process files older than <time>
ts<m,c,a>[N] Save or restore file time (modification, creation, access)
u        Update files
v        List all volumes
ver[n]   File version control
vp       Pause before each volume
x<file>  Exclude specified file
x@       Read file names to exclude from stdin
x@<list> Exclude files in specified list file
y Assume Yes on all queries

Leave a Reply

Your email address will not be published. Required fields are marked *

This is new type of CAPTCHA, make the puzzle please !WordPress CAPTCHA