Goga Goga - 22 days ago 8
Linux Question

How to gunzip without delete?

How to unzip

.gz
all archives without delete in specified folder?

I tried:
gunzip *.gz /folder

Answer

can be done with some bash scripting using gzip --stdout option and compute the uncompressed name with bash substitution:

for i in *.gz
do
   echo unzipping $i to /folder/${i/.gz}
   gunzip --stdout "$i" > "/folder/${i/.gz}"
done

the current implementation fails with filenames containing spaces