LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-05-2006, 11:28 PM   #1
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Rep: Reputation: 30
how do i add a folder into a rar archive


hi there i have a fedora core 4 server that i control throw ssh

my question is how do i add a folder (with sub folders and files in it) to a rar archive?

i have rar from rarlabs.com but can't find anywhere what the command is?


p.s. i'm not a n00b but rather just a confused linux user (in linux i use ark but throw ssh/command-line i have no idea)

Last edited by steve51184; 12-05-2006 at 11:30 PM.
 
Old 12-06-2006, 05:37 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Type "which rar" to find the command, type "rar a -r /some/dir /some/archive.rar" to recursively add files.
 
Old 12-06-2006, 12:10 PM   #3
z-vet
Member
 
Registered: Aug 2004
Location: Israel
Distribution: LMDE 5
Posts: 271

Rep: Reputation: 34
Why rar on Linux?
 
Old 12-06-2006, 12:35 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
rar is not a commonly used archive format on Linux. There are a few command line tools for handling rar files, but they aren't very feature rich.

Not sure about other distros, but Ubuntu carries a few implementations for rar processors:

unrar-free (universe repo). This is a GPL'd program which can extract rar archives. It has quite limited functionality.

rar and unrar (multiverse repository). Command line tools with some more features, but not under a free license. I seem to remember something about shareware and having to register after so many uses, but I might be wrong there.

Last edited by matthewg42; 12-06-2006 at 12:36 PM. Reason: link added
 
Old 12-06-2006, 12:45 PM   #5
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
tar and zip are much better alternatives in Linux. Especially if you plan on distributing your archive to multiple people.
 
Old 12-06-2006, 01:01 PM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
For single files bzip2 gives very good compression. You can archive lots of files together in a .tar file, and then compress that using bzip2 to get good compression ratios. GNU's implementation of tar will do this all in one operation is you use the j option, e.g.
Code:
tar cjf myarchive.tar.bz2 files and directories to add ...
The only down side to using tar files over zip or rar, is that there is no "table of contents" written at the start (or end - whatever) of the file. This means that to get a listing of the contents of a tar file, the program needs to read through the whole file, which for large tar files can take a long time.

Apart from this (in fact partly because of it), tar files can do things zip and rar files aren't suitable for - they can be used on non-random access devices such as tape drives - tar stands for tape archive). tar files can also contains multiple versions of a file with a given name, and you can choose which one to restore from the archive.

Having said all that, if you're not in control of the formats (e.g. you're administering a website which distributes rar files for windows users), the coolness of tar archives doesn't help you much. HO hum.
 
Old 12-06-2006, 04:27 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
rar is not a commonly used archive format on Linux.
..is an argument against, what?


There are a few command line tools for handling rar files, but they aren't very feature rich.
Where do you get that from?
Code:
rar.exe | grep ^RAR | gawk "{print $2}"
3.41
rar.exe | wc -l
106

rpm -q --queryformat "%{version}" rar
3.51
\rar | wc -l
102
As feature-rich as its Wintendo console cousin. (running "rar" w/o args shows help on switches)


Apart from this (in fact partly because of it), tar files can do things zip and rar files aren't suitable for
RAR OTOH can manage compression (sort of like Bzip2 does), retain DAC rights, use passwords, archive files before or after a certain date, create volumes, add recovery data and then some. And all that w/o external helper apps, unlike tar.
 
  


Reply

Tags
folders, linux, rar, ssh


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
How to add rar to the Karchiver path? bicho Linux - Software 1 11-04-2006 09:46 PM
anyone know how to bypass/retrieve rar archive passwords? jza Linux - General 4 06-14-2006 08:15 PM
Opening RAR archive in Linux? Bakoulou Linux - Software 2 02-10-2006 04:04 PM
RAR archive support on 64-bit systems? Phaethar Linux - Software 5 05-23-2005 12:12 AM
.rar archive help Fredstar Linux - Newbie 1 02-09-2005 03:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:20 PM.

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