Hi all, first post. I know this has been broached before and I
nearly have it down myself but I just can't figure the last step.
Basically, this is what I have:
~/directory1/subdirectory1/*.rar
~/directory1/subdirectory2/*.rar
~/directory2/subdirectory1/*.rar
etc..
I want to be able to extract all the rar files while keeping the file structure but moving all of the contents into an "unrared" directory. EG:
~/unrared/directory1/subdirectory1/extracted.files
~/unrared/directory1/subdirectory2/extracted.files
~/unrared/directory2/subdirectory1/extracted.files
So far I have this:
Code:
for f in `find . | grep .rar`
do
unrar x -o- "$f" ./unrared/
done
This will move the extracted files into the new directory, but will not keep the file structure.
I was thinking that I could move the files to the new structure first and then delete the archives as I extract them, but I would prefer not to as I am working with large amounts of data.
EDIT: you may be able to tell that I'm pretty much a beginner, so please go easy
