LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unrar from filelist (https://www.linuxquestions.org/questions/linux-newbie-8/unrar-from-filelist-800166/)

casoe84dk 04-05-2010 01:46 PM

Unrar from filelist
 
Hi LQ Users

I have a question.

Is it posible to unrar from a filelist in the shell?

I know the command
for r in *.rar; do unrar x $r; done

but the problem is that I have alot of backups in the folder and It's only lets say 10 out og 25 rar's I would like to unpack.

that is because I have used winrar on my old windows mashine to take backup of my documents, family video's, etc...

from Casper

Tinkster 04-05-2010 01:54 PM

Hi, and welcome to LQ!

I'm not sure if I understand your request correctly, but:

Assuming you have a file "names" that has 10 filenames in it, like so:

Code:

file1.rar
file5.rar
file12.rar
...

you can just do the following to unpack only those:
Code:

for r in $(cat names); do unrar x $r; done


Cheers,
Tink

casoe84dk 04-05-2010 02:34 PM

Thanks alot Tink

Thats did the output I was searching for.
I had totally forgotten that I could use the command cat in that command.

From
Casper


All times are GMT -5. The time now is 04:41 AM.