?
Solved

gunzip

Posted on 2004-04-02
7
Medium Priority
?
1,031 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 85

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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
LVL 85

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 300 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

770 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