Link to home
Start Free TrialLog in
Avatar of kousis
kousis

asked on

gunzip

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
Avatar of Lee Wadwell
Lee Wadwell
Flag of Australia image

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.
Avatar of oBdA
oBdA

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".
Avatar of kousis

ASKER

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

This command is not unzipping the files.
is there anyway to do this,
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")?
if gunzip.exe is in msdos7 folder for example  do like this

set path=%path%;c:\msdos7

and call as above explained
ASKER CERTIFIED SOLUTION
Avatar of sudhakar_koundinya
sudhakar_koundinya

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial