LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to compress a folder using rar? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-compress-a-folder-using-rar-833507/)

turf 09-21-2010 04:13 AM

how to compress a folder using rar?
 
how can i do it?

linuxlover.chaitanya 09-21-2010 04:19 AM

Rar is an archiver so it will not compress it like zip. You can use tar to compress and archive at the same time.

Code:

tar -czf file.tar.gz folder-to-be-tarred // z denotes it will create .gz file. You can use j for bzip2.

eco 09-21-2010 04:22 AM

Code:

$ rar a -m5 <yourFolder>
next time try
Code:

$ man rar

prayag_pjs 09-21-2010 04:25 AM

You need to use tar command as follows (syntax of tar command):
Code:

tar -zcvf archive-name.tar.gz directory-name
Where,
Quote:

-z: Compress archive using gzip program
-c: Create archive
-v: Verbose i.e display progress while creating archive
-f: Archive File name
For example, you have directory called /home/jerry/prog and you would like to compress this directory then you can type tar command as follows:

Code:

$ tar -zcvf prog-linuxtar.gz /home/prayag/prog

turf 09-21-2010 04:31 AM

i need it to be rar. sure i can unrar x *.rar
but seems the rar command aint found.

Quote:

root[Scripts]# rar a -m5 NewDir/
bash: rar: command not found
root[Scripts]#

linuxlover.chaitanya 09-21-2010 04:35 AM

Rar is not installed on Linux by default and you need to install it manually. Use package manager for your distribution to install it.

eco 09-21-2010 04:36 AM

Quote:

Originally Posted by turf (Post 4104272)
i need it to be rar. sure i can unrar x *.rar
but seems the rar command aint found.

Is rar installed?

If you are using debain or a variant of debian, look for it this way
Code:

$ dpkg -l |grep -i "ii  rar"
I got it working.

linuxlover.chaitanya 09-21-2010 04:37 AM

You need not have rar or create one. You can use tar to create a .tar archive and use rar package on windows to unrar it.

prayag_pjs 09-21-2010 04:40 AM

yum -y install unrar

prayag_pjs 09-21-2010 04:41 AM

http://www.rarlab.com/rar/unrarsrc-3.9.10.tar.gz

frankbell 09-22-2010 11:01 PM

Rar is proprietary.

There is a Linux version available, but it's neither free or open source, but, as a long-time Rar user, I must say that it is really slick.

Free alternatives might not decode files compressed with the latest version.

That aside, in some environments, such as Usenet, it has no peers and no competition; if you want to be there, you have to Rar.

If you're going spend a lot of time in those environments and you are not doctrinaire about FLOSS, it's worth the 20 bucks.

John VV 09-23-2010 03:56 AM

unrar is free to install BUT rar is NOT

you need to buy rar from there web site

now there is a free one floating around the web - do some research
but seeing at i live inside ( the new iron curtain - usa) i can be sued if i tell you where it is and how to install it

leejohnli 09-23-2010 04:03 AM

I think on debian or ubuntu side you can install rar using package manager. Mine, I used rar for some file compression so i did installed the package using "apt-get install rar", see if you can try that to you.

John VV 09-23-2010 04:07 AM

leejohnli some distros have corporate backing and buy a license
SUSE is one

leejohnli 09-23-2010 04:21 AM

Right, I forgot about the "RAR" one on linux. Thanx for correcting me.


All times are GMT -5. The time now is 11:13 AM.