LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 07:56 AM   #1
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 262

Rep: Reputation: 5
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, 09:40 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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, 02:33 AM   #3
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 262

Original Poster
Rep: Reputation: 5
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


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


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