LinuxQuestions.org
Visit Jeremy's Blog.
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 04-24-2003, 09:24 PM   #1
thanko
Member
 
Registered: Feb 2002
Location: MI
Distribution: Slackware 9.1
Posts: 83

Rep: Reputation: 15
Angry unzip


I have a folder /home/tim/downloads/BibleTime that contains about 280 .zip files. I would like to use unzip (or another unzipping utility) to extract all these files to /usr/share/sword but can't seem to get the right syntax.

I've tried

unzip /home/tim/downloads/BibleTime/* -d /usr/share/sword

and a few variations on that same theme, but ge this error message:

caution: filename not matched: /home/tim/downloads/BibleTime/xxx.zip

for each .zip file.

Any ideas?
 
Old 04-25-2003, 12:26 AM   #2
wr3ck3d
Member
 
Registered: Dec 2002
Location: IL
Distribution: NetBSD, Slackware, Gentoo, Debian, FreeBSD
Posts: 444

Rep: Reputation: 31
just go into the folder and run unzip *.zip

that should work i think???
 
Old 04-25-2003, 12:50 AM   #3
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Rep: Reputation: 30
try unziping each file induvidually
 
Old 04-25-2003, 07:02 AM   #4
thanko
Member
 
Registered: Feb 2002
Location: MI
Distribution: Slackware 9.1
Posts: 83

Original Poster
Rep: Reputation: 15
I can unzip each one individually but there are over 200 of them. That's why I was hoping there was a more efficient way.

unzip * yields the same results as before.
 
Old 04-25-2003, 07:07 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Code:
for i in *.zip 
do
  unzip $i
done

Last edited by acid_kewpie; 04-25-2003 at 07:15 AM.
 
Old 04-25-2003, 07:09 AM   #6
thanko
Member
 
Registered: Feb 2002
Location: MI
Distribution: Slackware 9.1
Posts: 83

Original Poster
Rep: Reputation: 15
I assume that needs to go in a script, right?
 
Old 04-25-2003, 07:10 AM   #7
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
How about a little shell script?
Code:
#!/bin/sh

for file in *.zip; do
  unzip $file
done
HTH

Jamie...
 
Old 04-25-2003, 07:12 AM   #8
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
Kewpie beats me to it by 3 mins!

Jamie...
 
Old 04-25-2003, 07:15 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
/me is too hot to handle....
 
Old 04-25-2003, 07:20 AM   #10
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
Quote:
Originally posted by acid_kewpie
acid_kewpie is too hot to handle....
Yet modest
 
Old 04-25-2003, 04:23 PM   #11
thanko
Member
 
Registered: Feb 2002
Location: MI
Distribution: Slackware 9.1
Posts: 83

Original Poster
Rep: Reputation: 15
Talking

However, acidkewpie, although his way may have worked, did not have the easiest solution.

unzip "*.zip" -d /usr/share/sword

The quote make sure that unzip processes *.zip rather than the shell.
 
Old 04-25-2003, 04:25 PM   #12
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
that worked? technically that would've been the wrong way to use it, as it would expand to

unzip "a.zip b.zip c.zip" -blah

which is strange really... but if it works... i was just guessing that unzip couldn't handle multiple files.. ou never said there were spaces in there did you...!
 
Old 05-02-2003, 05:13 AM   #13
debdas
LQ Newbie
 
Registered: May 2003
Posts: 19

Rep: Reputation: 0
how abt doing recursive unzip...like i have a file that has a folder that conatins a number of zipped files. can i unzip all of them in one go
??
 
Old 05-02-2003, 05:16 AM   #14
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
Not that I know of, as at the time you invoke unzip only a single file will exist. You'll just need to run unzip twice.

cheers

Jamie...
 
  


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
Not able to unzip arimus25 Linux - Software 6 11-14-2011 04:46 AM
unzip Jeebizz Slackware 5 08-28-2005 04:07 AM
how do you unzip something slacker2007 Linux - Newbie 2 08-01-2004 11:19 AM
Unzip PhuckFonix Linux - Newbie 1 05-30-2004 08:10 PM
Unzip? lintadsl Linux - General 6 12-01-2002 04:17 PM


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