LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-26-2009, 09:36 AM   #1
ebolamayinga
LQ Newbie
 
Registered: Sep 2009
Posts: 2

Rep: Reputation: 0
Question 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
 
Old 09-26-2009, 02:12 PM   #2
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
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.
 
Old 10-02-2009, 05:47 PM   #3
ebolamayinga
LQ Newbie
 
Registered: Sep 2009
Posts: 2

Original Poster
Rep: Reputation: 0
thx a lot. exactly what i needed.
 
  


Reply

Tags
bash, script, unzip


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
Cannot see files in subfolders of Windows server Mountain Linux - Newbie 2 03-30-2008 09:40 PM
Permissions propagating to subfolders & files linus Linux - General 2 06-21-2007 01:58 PM
extracting multiple files with tar -xjvf logicalfuzz Linux - Software 3 11-06-2005 02:21 AM
need a script to delete all files from a folder and subfolders cccc Programming 1 03-04-2005 11:54 AM
changeing permissions for a folder + subfolders and files ? YBA^[x] Slackware 7 08-06-2004 05:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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