LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 11-05-2007, 07:35 PM   #1
WildDrake!
Member
 
Registered: Dec 2003
Location: Current Location: Colorado
Distribution: Ubuntu 14.10, Mint 17.1 Cinnamon and Mate
Posts: 99

Rep: Reputation: 15
Super unrar???


I have a directory with about 300 .rar files. Is there a way to give a single command and have them all unrar-ed in one shot?

Thanks!
 
Old 11-05-2007, 07:42 PM   #2
crenclan
Member
 
Registered: Mar 2006
Location: North Ga. USA
Distribution: various
Posts: 39

Rep: Reputation: 15
I don't have an answer, but how did you accumulate so many ?
 
Old 11-05-2007, 07:52 PM   #3
WildDrake!
Member
 
Registered: Dec 2003
Location: Current Location: Colorado
Distribution: Ubuntu 14.10, Mint 17.1 Cinnamon and Mate
Posts: 99

Original Poster
Rep: Reputation: 15
It's how they were stored on a cd sent to me.
 
Old 11-05-2007, 08:09 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
Here's how to do it with the unrar program provided by the unrar package under Ubuntu, which identifies itself like this when the --help option is passed:
Code:
UNRAR 3.70 beta 3 freeware      Copyright (c) 1993-2007 Alexander Roshal
If the files are found in the path /home/me/rarfiles, and you want to unrar them into /home/me/unrarfiles:
Code:
cd /home/me/unrarfiles
for f in /home/me/rarfiles/*.rar; do
    unrar -o+ x "$f"
done
The -o+ means to overwrite any files which already exist, so if some rar files contain files with similar names, you will end up with only the last one from the last rar file which contained that file name. Omit this and you will be prompted if there are duplicates if you want to overwrite.
 
Old 11-05-2007, 08:48 PM   #5
WildDrake!
Member
 
Registered: Dec 2003
Location: Current Location: Colorado
Distribution: Ubuntu 14.10, Mint 17.1 Cinnamon and Mate
Posts: 99

Original Poster
Rep: Reputation: 15
A Script!!! You wrote a little program in the immediate mode. That's cool.

But, I am stuck in multi-line (>) mode. How do I get the program to execute now?
 
Old 11-05-2007, 08:53 PM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
The > will be printed if the shell is expecting the end of a quote, or a done after a do, or a fi after an if and so on. Just keep entering the mini-script and after the done it will execute.

If you really prefer it to be all on one line to avoid seeing the > prompt, you can do it like this:
Code:
cd /home/me/unrarfiles ; for f in /home/me/rarfiles/*.rar; do unrar -o+ x "$f"; done
 
Old 11-05-2007, 09:13 PM   #7
bjb1959
LQ Newbie
 
Registered: Jul 2007
Posts: 4

Rep: Reputation: 0
use wine and winrar

You can also install wine and then download winrar and install that using the command line wine winrar.exe from the directory where you downloaded it to. It even places an icon on your desktop and works perfectly. I have used it for several years this way.
 
Old 11-05-2007, 09:19 PM   #8
WildDrake!
Member
 
Registered: Dec 2003
Location: Current Location: Colorado
Distribution: Ubuntu 14.10, Mint 17.1 Cinnamon and Mate
Posts: 99

Original Poster
Rep: Reputation: 15
WOW! Sweet! That worked soooo cool! I added this to my notes. Thanks!
 
Old 11-05-2007, 09:21 PM   #9
WildDrake!
Member
 
Registered: Dec 2003
Location: Current Location: Colorado
Distribution: Ubuntu 14.10, Mint 17.1 Cinnamon and Mate
Posts: 99

Original Poster
Rep: Reputation: 15
Thanks bjb1959, I'll keep that in mind, but I want to be completely independent of M$ when the smoke clears....
 
Old 11-08-2007, 06:33 PM   #10
bjb1959
LQ Newbie
 
Registered: Jul 2007
Posts: 4

Rep: Reputation: 0
you can also use command line

ooops didn't see matthew's post, guess I should read first

Last edited by bjb1959; 11-08-2007 at 06:36 PM.
 
  


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
nfs write == super slow; read == super fast - problem? BrianK Linux - Networking 4 08-23-2007 10:59 PM
unrar selfextracted spx2 Linux - Software 3 09-05-2006 05:52 AM
Can not unrar Christoffer81 Linux - Newbie 3 06-15-2004 08:38 AM
How to use unrar? JunZ Linux - Software 1 06-05-2004 08:36 PM
Unrar vs. Winrar sore Linux - Software 4 10-14-2003 12:32 PM


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