Help on gunzip

Hi All,

I am using UNIX command to unzip the files
gzip -d9 DW_.gz
The Xmls are compressed using gzip and it is received in the .gz format at UNIX box which need to be uncompressed.
The above command is working fine for 400 compressed xmls(.gz files) but when the count becomes 401 or more i am facing a error like "The Parameter list is too long" and i am not able to uncompress the files.
I also tried with other commands like
gunzip DW_
.gz
unzip DW_*.gz.

Any help is greatly appreciated.

Maybe try something like

find . -type f -name "DW_*.gz" -exec gunzip {} \;
#or
find . -type f -name "DW_*.gz" -print | xargs gunzip

Hey thanks a lot :slight_smile:
Its working too good.....
Can u tell be the difference between the command which i used and what u suggested?
Thank a lot!!!!

Using it with find and/or xargs will hand over every found file to the program one by one, in your case gunzip. The way you used it will hand over all at once, and that will hit the max limit of parameters for this program.
Sometimes when you want to delete all files in a folder and issue a rm and have more than 512 files in there, you can encounter this problem too and help yourself with find and/or xargs for example.
Programs that accept parameters are usually limit to a fix amount of them.

Tats great yaar......
Thank u so much.
I have another doubt too.
Is there any command to compress multiple files into a single .gz files using gzip utility?
One option is to concat the files and then compress them. I have 1000 xmls and could you suggest me a command to concate them as a single file and compress using gzip?

Thanks for your efforts Taken!!!!
Great going!!!!

I would just tar them and then zip the tar archive.

To concatenate them I have no tool in mind to do that quickly. Would have to write a small script that concatenates them with cat and >> maybe.

Concat using cat command wud be a best option i guess.... Will try with that command too.........

move all the files to a folder and then use the below command
tar cvf - <foldername> |gzip > foldername.tar.gz