LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-21-2010, 05:13 AM   #1
turf
Member
 
Registered: Nov 2009
Posts: 94

Rep: Reputation: 15
how to compress a folder using rar?


how can i do it?
 
Old 09-21-2010, 05:19 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
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.
 
Old 09-21-2010, 05:22 AM   #3
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
Code:
$ rar a -m5 <yourFolder>
next time try
Code:
$ man rar
 
Old 09-21-2010, 05:25 AM   #4
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Thumbs up

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
 
Old 09-21-2010, 05:31 AM   #5
turf
Member
 
Registered: Nov 2009
Posts: 94

Original Poster
Rep: Reputation: 15
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]#
 
Old 09-21-2010, 05:35 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Rar is not installed on Linux by default and you need to install it manually. Use package manager for your distribution to install it.
 
Old 09-21-2010, 05:36 AM   #7
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
Quote:
Originally Posted by turf View Post
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.
 
Old 09-21-2010, 05:37 AM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
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.
 
Old 09-21-2010, 05:40 AM   #9
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
yum -y install unrar
 
Old 09-21-2010, 05:41 AM   #10
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
http://www.rarlab.com/rar/unrarsrc-3.9.10.tar.gz
 
Old 09-23-2010, 12:01 AM   #11
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,882
Blog Entries: 18

Rep: Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346
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.
 
Old 09-23-2010, 04:56 AM   #12
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,243

Rep: Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527
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
 
Old 09-23-2010, 05:03 AM   #13
leejohnli
Member
 
Registered: Sep 2010
Posts: 66

Rep: Reputation: 2
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.
 
Old 09-23-2010, 05:07 AM   #14
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,243

Rep: Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527
leejohnli some distros have corporate backing and buy a license
SUSE is one
 
Old 09-23-2010, 05:21 AM   #15
leejohnli
Member
 
Registered: Sep 2010
Posts: 66

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compress folder in rar infonlinebr Linux - Newbie 5 03-17-2016 03:08 PM
[SOLVED] Need a file extractor (rar, 7z, ect) for part files compress by winrar mothergoose729 Linux - Software 13 04-14-2010 03:57 AM
Compress one Folder saran_redhat Linux - Newbie 3 02-11-2010 07:54 PM
LXer: Basic commands Les I: Compress and decompress files using rar, bzip, tarball(t LXer Syndicated Linux News 0 07-10-2009 05:10 PM
How to compress a folder deWin Linux - Newbie 3 11-11-2004 11:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration