Re: unzipping files in a dir recursively

From: Gaurab (gaurab_at_ebi.ac.uk)
Date: 03/16/05


Date: Wed, 16 Mar 2005 17:03:20 GMT

Hi Chris,
thanks for the info, but the code you supplied I presume that its a
perl script that you wrote. So I run it as that, am I correct?

Thanks,
Gaurab

On 16 Mar 2005 13:29:43 GMT, "Chris F.A. Johnson"
<cfajohnson@gmail.com> wrote:

>On Wed, 16 Mar 2005 at 10:41 GMT, Gaurab wrote:
>> Hi,
>>
>> I have a dir containing a 50 subdir, each with files with *.zip
>> extension.
>> I need to unzip all the files but retain them in the subdir's.
>> I know with gunzip there is an option -r which tranverse's the dir
>> structure and unzips the files, but I do not think there is such an
>> option in unzip.
>
>man gunzip
>
> Files created by zip can be uncompressed by gzip only if they have a
> single member compressed with the 'deflation' method. This feature is
> only intended to help conversion of tar.zip files to the tar.gz format.
> To extract zip files with several members, use unzip instead of gunzip.
>
>
> Otherwise:
>
>for dir in */
>do
> ( cd "$dir" && unzip *.zip )
>done
>
>--
> Chris F.A. Johnson http://cfaj.freeshell.org/shell
> ===================================================================
> My code (if any) in this post is copyright 2005, Chris F.A. Johnson
> and may be copied under the terms of the GNU General Public License

Gaurab



Relevant Pages

  • Re: Help with gzip
    ... to compress a file: ... gunzip somefile.gz ... tried saving files as .gz and something happens but I cannot unzip them ...
    (Ubuntu)
  • Re: Combination uf tar and gunzip on Solaris
    ... >> I'm trying to use a combination of gunzip and tar to unpack and unzip a ... >> This will unzip the file, but it won't unpack. ...
    (comp.unix.solaris)
  • Re: unzipping files in a dir recursively
    ... On Wed, 16 Mar 2005 at 10:41 GMT, Gaurab wrote: ... > extension. ... > I need to unzip all the files but retain them in the subdir's. ... > I know with gunzip there is an option -r which tranverse's the dir ...
    (comp.unix.misc)
  • Re: scp write to pipe?
    ... local machine and unzip it on the fly so I write to a pipe and unzip it ... except that gunzip used to handle raw stdout output should use ...
    (comp.security.ssh)
  • Re: Combination uf tar and gunzip on Solaris
    ... > I'm trying to use a combination of gunzip and tar to unpack and unzip a ... > This will unzip the file, but it won't unpack. ...
    (comp.unix.solaris)