Solved

gunzip

Posted on 2004-04-02
7
1,025 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
7 Comments
 
LVL 25

Expert Comment

by:lwadwell
Comment Utility
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 82

Expert Comment

by:oBdA
Comment Utility
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
Comment Utility
for %a in ("Y:\our\directory\*.gz") do gunzip %a

This command is not unzipping the files.
is there anyway to do this,
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 82

Expert Comment

by:oBdA
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now