LinuxQuestions.org
Help answer threads with 0 replies.
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 10-25-2012, 06:56 AM   #1
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 271

Rep: Reputation: 6
unrar files from different folders in terminal


Hello,

Im trying to unrar files from multiple folders automatically using terminal.

I have multiple folders and I want unrar to extract *.r00 and then move on the the next folder from the root directory.

This is what I am trying but its not quite rite.

Code:
find -type f -name /bigdrive/Media/Movies/2012/* '*.r00' -exec unrar x {} \;
Another way I was thinking about doing this is using grep:

Code:
find /bigdrive/Media/Movies/2012/*/*.r00 | unrar *.r00 x
but that not right either.

Should I be using xargs or can I do this just using the find command?
 
Old 10-25-2012, 08:40 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Try -execdir to execute the unrar command inside the directory where the r00 archive is:
Code:
find /bigdrive/Media/Movies/2012 -name \*.r00 -execdir unrar x {} \;
 
1 members found this post helpful.
Old 10-26-2012, 01:33 AM   #3
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 271

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by colucix View Post
Try -execdir to execute the unrar command inside the directory where the r00 archive is:
Code:
find /bigdrive/Media/Movies/2012 -name \*.r00 -execdir unrar x {} \;
Thank you very much.

That works perfectly.
 
  


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
find -exec command to recursively delete files and folders in folders with X name Joan Murt Linux - Newbie 2 07-08-2009 04:35 PM
change color of folders and files in xterm (or any terminal) rksprst Linux - General 1 04-21-2007 06:42 PM
How Do I Unrar From An External Hard Drive in Terminal? Anthony1uk Linux - Newbie 2 07-28-2006 09:25 AM
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM
Coloured folders/files in terminal? neocookie Linux - Software 1 05-22-2004 11:31 PM

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

All times are GMT -5. The time now is 05:46 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