LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 04: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, 04:19 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

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, 04: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, 04:25 AM   #4
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
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, 04: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, 04:35 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

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, 04: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, 04:37 AM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

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, 04:40 AM   #9
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
yum -y install unrar
 
Old 09-21-2010, 04:41 AM   #10
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
http://www.rarlab.com/rar/unrarsrc-3.9.10.tar.gz
 
Old 09-22-2010, 11:01 PM   #11
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
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, 03:56 AM   #12
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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, 04: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, 04:07 AM   #14
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
leejohnli some distros have corporate backing and buy a license
SUSE is one
 
Old 09-23-2010, 04: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



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 02:08 PM
[SOLVED] Need a file extractor (rar, 7z, ect) for part files compress by winrar mothergoose729 Linux - Software 13 04-14-2010 02:57 AM
Compress one Folder saran_redhat Linux - Newbie 3 02-11-2010 06:54 PM
LXer: Basic commands Les I: Compress and decompress files using rar, bzip, tarball(t LXer Syndicated Linux News 0 07-10-2009 04:10 PM
How to compress a folder deWin Linux - Newbie 3 11-11-2004 10:00 PM

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

All times are GMT -5. The time now is 12:22 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
Open Source Consulting | Domain Registration