Solved

gunzip

Posted on 2004-04-02
7
1,029 Views
Last Modified: 2009-07-29
I have directory of files of extension .GZ i did GUNZIP in one folder. is there any method that gunzip continues to next folder after finishing 1st folder.
my aim is to unzip all the folders in particular directory in single command.
is there any possible way...

TIA
0
Comment
Question by:kousis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 25

Expert Comment

by:lwadwell
ID: 10739261
The version of gzip and gunzip that I use supports recursion...

in the parent directory I can type

gzip -r *

and all file in the parent directory and its subdirectories are zipped, conversely

gunzip -r *

will unzip them all.
0
 
LVL 84

Expert Comment

by:oBdA
ID: 10739581
The following command will do that:

for %a in ("Y:\our\directory\*.gz") do gunzip %a

If you want to use this in a batch script, replace the "%a" with "%%a".
0
 

Author Comment

by:kousis
ID: 10739764
for %a in ("Y:\our\directory\*.gz") do gunzip %a

This command is not unzipping the files.
is there anyway to do this,
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 84

Expert Comment

by:oBdA
ID: 10740140
If gunzip.exe is not in the path, you'll have to specify the full path of the exe:
for %a in ("Y:\our\directory\*.gz") do "T:\he\install\directory\gunzip.exe %a
And just to be sure: you did replace the path to the directory with your path ("Y:\our\directory\*.gz")?
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 10830186
if gunzip.exe is in msdos7 folder for example  do like this

set path=%path%;c:\msdos7

and call as above explained
0
 
LVL 14

Accepted Solution

by:
sudhakar_koundinya earned 100 total points
ID: 10830203
create myunzip.bat

and enter following code in it

@echo off
set path=%path%;c:\msdos7
rem assuming gunzip.exe in msdos7 directory
 for %a in ("Y:\our\directory\*.gz") do gunzip %a


at command prompt execute like this
myunzip mydirectory
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question