LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   extracting multiple files into subfolders (https://www.linuxquestions.org/questions/linux-software-2/extracting-multiple-files-into-subfolders-757908/)

ebolamayinga 09-26-2009 08:36 AM

extracting multiple files into subfolders
 
hi there,

i want to extract multiple .zip files into subfolders based on the name of the zip file. (like using the "extract to subfolders" function of winrar's explorer integration on win).
i tried ark's konqueror integration (kde 3.5 on a gentoo machine) wich offers such a feature. on win winrar handles the zip files in a sequential order (i.e. one zip file after another). ark did that paralelly. the problem now is that after the smallest of these zip files is finished all instances of ark are being killed automatically and the other zip files extraction is incomplete.
anyone got a solution to this? (e.g. a bash script to do the job?)
thx in advance!
greets,
ebola

clvic 09-26-2009 01:12 PM

A bash script? Try this one, that unzips all zip files that are in a single folder, each one in its folder. Then, directly from the command line, type:

for i in *.zip; do echo $i; mkdir "`basename "$i" .zip`"; unzip "$i" -d "`basename "$i" .zip`"; done

The script is full of " because of the possibility that filenames contain spaces.

ebolamayinga 10-02-2009 04:47 PM

thx a lot. exactly what i needed.


All times are GMT -5. The time now is 01:21 AM.